This library is an attempt to implement the entire Wink API in Python 3. Documentation for the Wink API can be found here http://docs.winkapiv2.apiary.io/# however, from my experience it isn't kept up-to-date.
This library also has support for the unoffical local API and doesn't require a rooted hub.
This library provides support for Wink in Home Assistant!
pip3 install python-wink
- Vist https://developer.wink.com/login
- Crate an account and request your credentials. (Approval can take several days)
- Enter in a redirect URL to point at your application.
- Plug in your details into the test script below.
Print all light names and state, and toggle their states.
import pywink
print("Please vist the following URL to authenticate.")
print(pywink.get_authorization_url("YOUR_CLIENT_ID", "YOUR_REDIRECT_URL"))
code = input("Enter code from URL:")
auth = pywink.request_token(code, "YOUR_CLIENT_SECRET")
pywink.set_wink_credentials("YOUR_CLIENT_ID", "YOUR_CLIENT_SECRET",
auth.get("access_token"), auth.get("refresh_token"))
lights = pywink.get_light_bulbs()
for light in lights:
print("Name: " + light.name())
print("State: " + light.state())
light.set_state(not light.state())