Bridge API¶
-
class
huegely.Bridge(ip, username=None, transition_time=None)[source]¶ -
get_token(app_identifier)[source]¶ Gets a new authorisation token. Use this token to initialize a bridge object.
Arguments: ip: ip of bridge app_identifier: name of the app (should be unique per bridge)
-
make_request(path=None, method='GET', full_url=None, **data)[source]¶ Utility function for HTTP GET/PUT requests for the API.
Instead of calling this with the “path” argument which uses the bridge’s base url with authentication included, you can pass in “full_url” to bypass this behaviour.
For POST/PUT requests: Returns a processed dictionary of updated attributes/values like
{'brightness': 100, 'on': True, 'name': 'new name'}.For GET requests: Returns the unmodified api response.
If any updates fail, a HueError is raised.
-