Huex
Elixir client for Philips Hue connected light bulbs.
Query functions return the response from the API.
Command functions return a Bridge
struct in order to be pipeline friendly.
Read more on the GitHub page.
Summary
authorize(bridge, username) | Request authorization for the given |
connect(host, username \\ nil) | Creates a connection with the bridge available on the given host or IP address. Requires the connection to be authorized |
info(bridge) | Fetch all informations available in the |
light_info(bridge, light) | Fetch all informations available about the given |
lights(bridge) | List the lights conneted to the given |
set_brightness(bridge, light, brightness) | Sets the brigthness of the given light (a value between 0 and 1) Requires the connection to be authorized |
set_color(bridge, light, arg3) | Sets the color of the given light using Philips’ proprietary bi-dimensional color space Requires the connection to be authorized |
set_state(bridge, light, new_state) | Sets the state of the given light. For a list of accepted keys, look at the |
turn_off(bridge, light) | Turn the given light off Requires the connection to be authorized |
turn_on(bridge, light) | Turn the given light on Requires the connection to be authorized |
Functions
Request authorization for the given username
on the given bridge
Returns an “authorized” connection.
The authorization process is as follow:
1. Call authorize
once, it will return an error
2. Press the link button on top of your bridge device
3. Call authorize
again with the same parameters, it should succeed
Creates a connection with the bridge available on the given host or IP address. Requires the connection to be authorized.
Fetch all informations available about the given light
connected to the bridge
Requires the connection to be authorized.
List the lights conneted to the given bridge
Requires the connection to be authorized.
Sets the brigthness of the given light (a value between 0 and 1) Requires the connection to be authorized.
Sets the color of the given light using Philips’ proprietary bi-dimensional color space Requires the connection to be authorized.
Sets the state of the given light. For a list of accepted keys, look at the state
object in the response of light_info
Requires the connection to be authorized.
Turn the given light off Requires the connection to be authorized.