liblightify
|
Enumerations | |
enum | lightify_node_type { LIGHTIFY_ONOFF_PLUG, LIGHTIFY_DIMABLE_LIGHT, LIGHTIFY_COLOUR_LIGHT, LIGHTIFY_EXT_COLOUR_LIGHT, LIGHTIFY_CCT_LIGHT, LIGHTIFY_UNKNOWNTYPE = 0xFF00 } |
enum | lightify_node_online_state { LIGHTIFY_OFFLINE = 0, LIGHTIFY_ONLINE = 2 } |
Node online / offline information provided from the gateway
Enumerator | |
---|---|
LIGHTIFY_OFFLINE |
offline |
LIGHTIFY_ONLINE |
online |
Definition at line 118 of file liblightify.h.
enum lightify_node_type |
Known lamp types and what they can do.
Definition at line 105 of file liblightify.h.
int lightify_node_get_blue | ( | struct lightify_node * | node | ) |
int lightify_node_get_brightness | ( | struct lightify_node * | node | ) |
int lightify_node_get_cct | ( | struct lightify_node * | node | ) |
struct lightify_node* lightify_node_get_from_mac | ( | struct lightify_ctx * | ctx, |
uint64_t | mac | ||
) |
Search node via its MAC address.
Search node via its unique ZLL MAC Address.
ctx | Library context |
mac | MAC Adress of node (64 bit value, guaranteed to be unique) |
Find node via mac address (from cache)
ctx | context |
mac | 64bit mac adress |
int lightify_node_get_green | ( | struct lightify_node * | node | ) |
uint16_t lightify_node_get_grpadr | ( | struct lightify_node * | node | ) |
enum lightify_node_type lightify_node_get_lamptype | ( | struct lightify_node * | node | ) |
const char* lightify_node_get_name | ( | struct lightify_node * | node | ) |
struct lightify_node* lightify_node_get_next | ( | struct lightify_ctx * | ctx, |
struct lightify_node * | node | ||
) |
Returns the next node in the linked list
ctx | library context |
node | get the next from this node; if NULL, returns the first node |
uint64_t lightify_node_get_nodeadr | ( | struct lightify_node * | node | ) |
int lightify_node_get_onlinestate | ( | struct lightify_node * | node | ) |
struct lightify_node* lightify_node_get_previous | ( | struct lightify_ctx * | ctx, |
struct lightify_node * | node | ||
) |
int lightify_node_get_red | ( | struct lightify_node * | node | ) |
int lightify_node_get_white | ( | struct lightify_node * | node | ) |
uint16_t lightify_node_get_zoneadr | ( | struct lightify_node * | node | ) |
int lightify_node_is_on | ( | struct lightify_node * | node | ) |
int lightify_node_is_stale | ( | struct lightify_node * | node | ) |
Check if we think that the cache is actual with lamp state.
A lamp can become stale if a command manipulating its state failed.
Staleness is reset after scanning for nodes or updating a node.
node | lamp |
int lightify_node_request_brightness | ( | struct lightify_ctx * | ctx, |
struct lightify_node * | node, | ||
unsigned int | level, | ||
unsigned int | fadetime | ||
) |
int lightify_node_request_cct | ( | struct lightify_ctx * | ctx, |
struct lightify_node * | node, | ||
unsigned int | cct, | ||
unsigned int | fadetime | ||
) |
int lightify_node_request_onoff | ( | struct lightify_ctx * | ctx, |
struct lightify_node * | node, | ||
int | onoff | ||
) |
int lightify_node_request_rgbw | ( | struct lightify_ctx * | ctx, |
struct lightify_node * | node, | ||
unsigned int | r, | ||
unsigned int | g, | ||
unsigned int | b, | ||
unsigned int | w, | ||
unsigned int | fadetime | ||
) |
int lightify_node_request_scan | ( | struct lightify_ctx * | ctx | ) |
Ask the gateway to provide informations about attached nodes
The library will query the gateway to submit all known nodes.
Disappeared nodes (and ones with stale information that cannot be updated) will be removed from the list.
ctx | context |
int lightify_node_request_update | ( | struct lightify_ctx * | ctx, |
struct lightify_node * | node | ||
) |
Update node information cache
This function queries the gateway about current node information and the data stored in the node's struct will be updated with the information from it. This will also reset stale status, if it was previously set and the command executed successfully.
ctx | context |
node | node |