View Source HueSDK.API.Lights (HueSDK v0.1.1)
Interface to the Lights API.
See the official documentation for more information.
Link to this section Summary
Functions
Deletes a light from the bridge.
Gets a list of all lights that have been discovered by the bridge.
Gets the attributes and state of a given light.
Gets a list of lights that were discovered the last time a search for new lights was performed. The list of new lights is always deleted when a new search is started.
Starts searching for new lights.
Used to rename lights. A light can have its name changed when in any state, including when it is unreachable or off.
Allows the user to turn the light on and off, modify the hue and effects.
Link to this section Functions
@spec delete_light(HueSDK.Bridge.t(), String.t()) :: HueSDK.HTTP.response()
Deletes a light from the bridge.
@spec get_all_lights(HueSDK.Bridge.t()) :: HueSDK.HTTP.response()
Gets a list of all lights that have been discovered by the bridge.
@spec get_light_attributes_and_state(HueSDK.Bridge.t(), String.t()) :: HueSDK.HTTP.response()
Gets the attributes and state of a given light.
@spec get_new_lights(HueSDK.Bridge.t()) :: HueSDK.HTTP.response()
Gets a list of lights that were discovered the last time a search for new lights was performed. The list of new lights is always deleted when a new search is started.
@spec search_for_new_lights(HueSDK.Bridge.t()) :: HueSDK.HTTP.response()
Starts searching for new lights.
The bridge will open the network for 40s. The overall search might take longer since the configuration of (multiple) new devices can take longer. If many devices are found the command will have to be issued a second time after discovery time has elapsed. If the command is received again during search the search will continue for at least an additional 40s.
When the search has finished, new lights will be available using the get new lights command. In addition, the new lights will now be available by calling get all lights or by calling get group attributes on group 0. Group 0 is a special group that cannot be deleted and will always contain all lights known by the bridge.
@spec set_light_name(HueSDK.Bridge.t(), String.t(), String.t()) :: HueSDK.HTTP.response()
Used to rename lights. A light can have its name changed when in any state, including when it is unreachable or off.
@spec set_light_state(HueSDK.Bridge.t(), String.t(), map()) :: HueSDK.HTTP.response()
Allows the user to turn the light on and off, modify the hue and effects.