liblightify
Group manipulation and state

Functions

struct lightify_grouplightify_group_get_next (struct lightify_ctx *ctx, struct lightify_group *current)
 
struct lightify_grouplightify_group_get_previous (struct lightify_ctx *ctx, struct lightify_group *current)
 
const char * lightify_group_get_name (struct lightify_group *grp)
 
int lightify_group_get_id (struct lightify_group *grp)
 
int lightify_group_request_scan (struct lightify_ctx *ctx)
 
struct lightify_nodelightify_group_get_next_node (struct lightify_group *grp, struct lightify_node *lastnode)
 
int lightify_group_request_onoff (struct lightify_ctx *ctx, struct lightify_group *group, int onoff)
 
int lightify_group_request_cct (struct lightify_ctx *ctx, struct lightify_group *group, unsigned int cct, unsigned int fadetime)
 
int lightify_group_request_rgbw (struct lightify_ctx *ctx, struct lightify_group *group, unsigned int r, unsigned int g, unsigned int b, unsigned int w, unsigned int fadetime)
 
int lightify_group_request_brightness (struct lightify_ctx *ctx, struct lightify_group *group, unsigned int level, unsigned int fadetime)
 

Detailed Description

Function Documentation

int lightify_group_get_id ( struct lightify_group grp)

Get the ID of the group

Parameters
grp
Returns
group id or negative on error.

Definition at line 128 of file groups.c.

const char* lightify_group_get_name ( struct lightify_group grp)

Get the name associated with the group

Parameters
grpGroup pointer
Returns
pointer to a string with the name

Definition at line 117 of file groups.c.

struct lightify_group* lightify_group_get_next ( struct lightify_ctx ctx,
struct lightify_group current 
)

Get next known group

Parameters
ctxcontext
currentlast group queried
Returns
next group in list or NULL if there isn't one

Definition at line 134 of file groups.c.

struct lightify_node* lightify_group_get_next_node ( struct lightify_group grp,
struct lightify_node lastnode 
)

Get the next node ptr associated with the group

Parameters
grpgroup the node must be in
lastnodelast node asked for, NULL if the first
Returns
NULL is not found, else pointer.
Note
you must scan for nodes to be able to associate nodes with the groups.

Definition at line 147 of file groups.c.

struct lightify_group* lightify_group_get_previous ( struct lightify_ctx ctx,
struct lightify_group current 
)

Get previous known group

Parameters
ctxcontext
currentlast group queried
Returns
previous group in list or NULL if there isn't one

Definition at line 140 of file groups.c.

int lightify_group_request_brightness ( struct lightify_ctx ctx,
struct lightify_group group,
unsigned int  level,
unsigned int  fadetime 
)

Set Group brightness

Parameters
ctx
group
level
fadetime
Returns
>=0 on success. negative on error.

Definition at line 1223 of file context.c.

int lightify_group_request_cct ( struct lightify_ctx ctx,
struct lightify_group group,
unsigned int  cct,
unsigned int  fadetime 
)

Set group CCT

Parameters
ctxcontext
groupgroup
cctCCT
fadetimetime in 1/10 secs
Returns
>=0 on success. negative on error.

Definition at line 1192 of file context.c.

int lightify_group_request_onoff ( struct lightify_ctx ctx,
struct lightify_group group,
int  onoff 
)

Request group to be turned off or on

Parameters
ctxcontext
groupgroup ptr
onoffon or off ( true or false)
Returns
>=0 on success. negative on error.

Definition at line 1178 of file context.c.

int lightify_group_request_rgbw ( struct lightify_ctx ctx,
struct lightify_group group,
unsigned int  r,
unsigned int  g,
unsigned int  b,
unsigned int  w,
unsigned int  fadetime 
)

Set RGBW values

Note
some lamps cannot set white, also white and rgb might be exclusive.
Parameters
ctxcontext
group
rred
ggreen
bblue
wwhite
fadetime
Returns
>=0 on success. negative on error.

Definition at line 1205 of file context.c.

int lightify_group_request_scan ( struct lightify_ctx ctx)

Request the list of known groups

Parameters
ctxcontext
Returns
negative on error, else number of retrieved groups (might be zero)

Definition at line 1082 of file context.c.