liblightify
lightify-util.c
Go to the documentation of this file.
1 /*
2  liblightify -- library to control OSRAM's LIGHTIFY
3 
4  Copyright (c) 2015, Tobias Frost <tobi@coldtobi.de>
5  All rights reserved.
6 
7  Redistribution and use in source and binary forms, with or without
8  modification, are permitted provided that the following conditions are met:
9 
10  * Redistributions of source code must retain the above copyright
11  notice, this list of conditions and the following disclaimer.
12 
13  * Redistributions in binary form must reproduce the above copyright
14  notice, this list of conditions and the following disclaimer in the
15  documentation and/or other materials provided with the distribution.
16 
17  * Neither the name of the author nor the
18  names of its contributors may be used to endorse or promote products
19  derived from this software without specific prior written permission.
20 
21  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
22  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
23  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
24  DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
25  DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
26  (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
27  LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
28  ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
29  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
30  SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31  */
32 
33 #include <stdio.h>
34 #include <stdlib.h>
35 #include <netdb.h>
36 #include <string.h>
37 
39 #include <unistd.h>
40 
41 #include <fcntl.h>
42 
43 #include <getopt.h>
44 #include <time.h>
45 
46 #include <errno.h>
47 
48 
49 /* Flag set by ‘--verbose’. */
50 static int verbose_flag;
51 
52 static struct option long_options[] = {
53 /* These options set a flag. */
54 { "verbose", no_argument, &verbose_flag, 1 },
55 { "brief", no_argument, &verbose_flag, 0 },
56 /* These options don’t set a flag.
57  We distinguish them by their indices. */
58 { "cct", required_argument, 0, 'c' },
59 { "rgbw", required_argument, 0, 'r' },
60 { "level", required_argument, 0, 'l' },
61 { "name", required_argument, 0, 'n' },
62 { "host", required_argument, 0, 'h' },
63 { "port", required_argument, 0, 'p' },
64 { "on", required_argument, 0, '0' },
65 { "off", required_argument, 0, '1' },
66 { "time", required_argument, 0, 't' },
67 { "list-nodes", no_argument, 0, 'd' },
68 { "wait", required_argument, 0, 'w' },
69 { "list-groups", no_argument, 0, 2},
70 { "group", required_argument, 0, 'g' },
71 { "update", no_argument, 0, 'u' },
72 { 0, 0, 0, 0 }
73 };
74 /* getopt_long stores the option index here. */
75 
76 // commands data
77 int command_cct = 0;
79 
80 int command_r = 0;
81 int command_r_r = 0;
82 int command_r_g = 0;
83 int command_r_b = 0;
84 int command_r_w = 0;
85 
86 int command_l = 0;
88 
89 //int name = 0;
90 
91 char *name_data = NULL;
92 
93 char *group_data = NULL;
94 
95 char *host_data = NULL;
96 
97 int port = 4000;
98 
100 
101 int gonnected = 0;
102 
103 int sockfd;
104 
105 void usage(char *argv[]) {
106  printf("Usage: %s [OPTIONS] \n", argv[0]);
107  printf(" --host,-h <host> Hostname or IP\n");
108  printf(" [--verbose] Verbose mode\n");
109  printf(" [--list-nodes,-d] Dump info about lamps\n");
110  printf(" [--list-groups] Show all known groups\n");
111  printf(" [--wait,-w <value>] Wait for value/10 seconds\n");
112  printf(" [--time,-t <value>] Set fading time in 1/10 seconds\n");
113  printf(" [--name,-n <value>] Name of the lamp to be manipulated\n");
114  printf(" [--group,-g <value>] Name of the lamp to be manipulated\n");
115  printf(" [--port,-p <port>] Port, default 4000\n");
116  printf(" [--on,-0] Turn lamp on\n");
117  printf(" [--off,-1] Turn lamp off\n");
118  printf(" [--level,-l <value>] Set intensity level. Range 0 to 100\n");
119  printf(" [--cct,-c <value>] CCT to be set.\n");
120  printf(" [--rgbw,-r <value>] Set color. Give color as r,g,b,w. Color values from 0 to 255\n");
121  printf(" [--update,-u] Refresh a node's information (requires name set before)\n");
122  printf("\n Host must be given before any command. Commands on and off can broadcast to all lamps if name is not given before.\n");
123  printf("\n All other commands needs either a name or group set before.\n");
124 }
125 
126 struct lightify_node* find_node_per_name(struct lightify_ctx *ctx, const char *name) {
127  if (!name) return NULL;
128  struct lightify_node *node = NULL;
129  while ((node = lightify_node_get_next(ctx, node))) {
130  if (0 == strcmp(name, lightify_node_get_name(node))) {
131  return node;
132  }
133  }
134  fprintf(stderr, "ERROR: Node %s not found\n", name);
135  return NULL;
136 }
137 
138 struct lightify_group* find_grp_per_name(struct lightify_ctx *ctx, const char *name) {
139  if (!name) return NULL;
140  struct lightify_group *group = NULL;
141  while( (group = lightify_group_get_next(ctx, group))) {
142  if (0 == strcmp(name, lightify_group_get_name(group))) {
143  return group;
144  }
145  }
146  fprintf(stderr, "ERROR: Group %s not found\n", name);
147  return NULL;
148 }
149 
150 void command_set_0_1(struct lightify_ctx *ctx, int command_on) {
153  char *type, *name;
154 
155  command_on = command_on > 0 ? 1 : 0;
156  if (!name_data && !group_data) {
157  type = "Broadcast"; name = "";
158  lightify_node_request_onoff(ctx, NULL, command_on);
159  } else if (node) {
160  type = "Node"; name = name_data;
161  lightify_node_request_onoff(ctx, node, command_on);
162  } else if (grp) {
163  type = "Group"; name = group_data;
164  lightify_group_request_onoff(ctx,grp,command_on);
165  } else {
166  return;
167  }
168 
169  if (verbose_flag) {
170  printf("%s %s switch %s\n", type, name , command_on ? "on" : "off");
171  }
172 }
173 
177  char *type, *name;
178 
179  if(node) {
180  type = "Node"; name = name_data;
182  } else if (grp) {
183  type = "Group"; name = group_data;
185  } else {
186  return;
187  }
188 
189  if (verbose_flag) {
190  printf("%s %s cct %dK in time %d\n", type, name, command_cct_data, fadetime );
191  }
192 }
193 
197  char *type, *name;
198 
199  if(node) {
200  type ="Node"; name = name_data;
203  } else if (grp) {
204  type ="Group"; name = group_data;
207  } else {
208  return;
209  }
210 
211  if (verbose_flag) {
212  printf("%s %s rgbw %d,%d,%d,%d in time %d\n", type, name, command_r_r,
214  }
215 }
216 
220  char *type, *name;
221 
222  if(node) {
223  type ="Node"; name = name_data;
225  } else if (grp) {
226  type ="Group"; name = group_data;
228  } else {
229  return;
230  }
231 
232  if (verbose_flag) {
233  printf("%s %s brightness %d in time %d\n", type, name, command_l_data, fadetime);
234  }
235 }
236 
239  if (!node) {
240  return;
241  }
242  int ret = lightify_node_request_update(ctx,node);
243  printf("update_node ret=%d\n", ret);
244 }
245 
247  /* Create a socket point */
248  int err;
249  struct sockaddr_in serv_addr;
250  struct hostent *server;
251 
252  sockfd = socket(AF_INET, SOCK_STREAM, 0);
253 
254  if (sockfd < 0) {
255  perror("ERROR opening socket");
256  exit(1);
257  }
258  server = gethostbyname(host_data);
259 
260  if (server == NULL) {
261  fprintf(stderr, "ERROR, no such host\n");
262  exit(1);
263  }
264 
265  bzero((char *) &serv_addr, sizeof(serv_addr));
266  serv_addr.sin_family = AF_INET;
267  bcopy((char *) server->h_addr, (char *)&serv_addr.sin_addr.s_addr, server->h_length);
268  serv_addr.sin_port = htons(port);
269 
270  /* Now connect to the server */
271  if (connect(sockfd, (struct sockaddr*) &serv_addr, sizeof(serv_addr)) < 0) {
272  perror("ERROR connecting");
273  exit(1);
274  }
275 
276  err = lightify_skt_setfd(ctx, sockfd);
277  if (err < 0) {
278  fprintf(stderr, "Could not set fd\n");
279  exit(1);
280  }
281 
282  gonnected = 1;
283 
284  // scan nodes
286  if (err < 0) {
287  fprintf(stderr,
288  "Error during node scan -- lets see if we've got partial data\n");
289  }
290 
291  // scan groups
293  if (err < 0) {
294  fprintf(stderr,
295  "Error during group scan -- lets see if we've got partial group data\n");
296  }
297 }
298 
299 
300 const char *decode_online_state(int state) {
301  switch (state) {
302  case LIGHTIFY_OFFLINE:
303  return "offline";
304  case LIGHTIFY_ONLINE:
305  return "online";
306  default:
307  return "unknown";
308  }
309 }
310 
311 const char *decode_lamptype(int type) {
312  switch (type) {
313  case LIGHTIFY_ONOFF_PLUG:
314  return "oo-plug";
316  return "dim";
318  return "color";
320  return "ext-col";
321  case LIGHTIFY_CCT_LIGHT:
322  return "cct";
324  return "4way-sw";
325  default:
326  return "unknown";
327  }
328 }
329 
330 const char *decode_onoff_sate(int state) {
331  if (state < 0) return "err";
332  switch (state) {
333  case 0:
334  return "off";
335  case 1:
336  return "on";
337  default:
338  return "???";
339  }
340 }
341 
342 void dump_nodes_state(struct lightify_ctx *ctx) {
343  int count=0;
344  // Let's create a short table...
345  // 1234567890123456 1234567812345678
346  printf("|------------------|------------------|---------|--------|---------|-----|-----|------|-----|-----|-----|-----|---|\n");
347  printf("| Name | MAC | type | group | online | 0/1 | dim | CCT | Red | Grn | Blu | Wht | s |\n");
348  printf("|------------------|------------------|---------|--------|---------|-----|-----|------|-----|-----|-----|-----|---|\n");
349  struct lightify_node *node = NULL;
350 
351  while (( node = lightify_node_get_next(ctx, node))) {
352  count++;
353  printf("| %-16s |" , lightify_node_get_name(node));
354  printf(" %016llx |" , lightify_node_get_nodeadr(node));
355  printf(" %-7s |", decode_lamptype(lightify_node_get_lamptype(node)));
356  printf(" 0x%04x |", lightify_node_get_grpadr(node));
357  printf(" %-7s |", decode_online_state(lightify_node_get_onlinestate(node)));
358  printf(" %-3s |", decode_onoff_sate(lightify_node_is_on(node)));
359  printf(" %-3d |", lightify_node_get_brightness(node));
360  printf(" %-4d |", lightify_node_get_cct(node));
361  printf(" %-3d |", lightify_node_get_red(node));
362  printf(" %-3d |", lightify_node_get_green(node));
363  printf(" %-3d |", lightify_node_get_blue(node));
364  printf(" %-3d |", lightify_node_get_white(node));
365  printf(" %c |\n", lightify_node_is_stale(node) ? '*' :' ');
366  }
367 
368  if (!count) {
369  printf("no nodes found\n");
370  }
371  printf("|------------------|------------------|---------|--------|---------|-----|-----|------|-----|-----|-----|-----|---|\n");
372 }
373 
374 void dump_groups(struct lightify_ctx *ctx) {
375 
376  struct lightify_group *group = NULL;
377  printf("|------------------|----|--------|----------------\n");
378  printf("| Group Name | id | mask | Group members\n");
379  printf("|------------------|----|--------|----------------\n");
380  while ((group = lightify_group_get_next(ctx,group))) {
381  printf("| %-16s | %-2d | 0x%04x |", lightify_group_get_name(group), lightify_group_get_id(group), 1 << (lightify_group_get_id(group)-1));
382  struct lightify_node *node = NULL;
383  while(node = lightify_group_get_next_node(group, node)) printf(" %s", lightify_node_get_name(node));
384  printf("\n");
385  }
386  printf("|------------------|----|--------|----------------\n");
387 }
388 
389 
390 
391 int main(int argc, char *argv[]) {
392  int option_index = 0;
393 
394  int c, err;
395  int n;
396 
397  struct lightify_ctx *ctx;
398 
399  err = lightify_new(&ctx, NULL );
400  if (err < 0) {
401  fprintf(stderr, "Cannot allocate library context\n");
402  exit(1);
403  }
404 
405 
406  while (1) {
407  c = getopt_long(argc, argv, "dc:r:l:n:h:p:01t:w:g:u", long_options,
408  &option_index);
409  if (c == -1)
410  break;
411 
412  switch (c) {
413 
414  case '0':
415  if (!host_data) { usage(argv); exit(1); }
416  if (!gonnected) setup_connection(ctx);
417  command_set_0_1(ctx,0);
418  break;
419 
420  case '1':
421  if (!host_data) { usage(argv); exit(1); }
422  if (!gonnected) setup_connection(ctx);
423  command_set_0_1(ctx,1);
424  break;
425 
426  case 'c':
427  if (!host_data || (!name_data && !group_data) ) {
428  usage(argv);
429  exit(1);
430  }
431  if (!gonnected) setup_connection(ctx);
432  command_cct = 1;
433  command_cct_data = strtol(optarg, NULL, 10);
434  command_set_cct(ctx);
435  break;
436 
437  case 'r':
438  if (!host_data || (!name_data && !group_data)) {
439  usage(argv);
440  exit(1);
441  }
442  if (!gonnected) setup_connection(ctx);
443  command_r = 1;
444  sscanf(optarg, "%d,%d,%d,%d", &command_r_r, &command_r_g,
446  command_set_rgbw(ctx);
447  break;
448 
449  case 'l':
450  if (!host_data || (!name_data && !group_data)) {
451  usage(argv);
452  exit(1);
453  }
454  if (!gonnected) setup_connection(ctx);
455  command_l = 1;
456  command_l_data = strtol(optarg, NULL, 10);
457  command_set_lvl(ctx);
458  break;
459 
460  case 'n':
461  name_data = optarg;
462  group_data = NULL;
463  break;
464 
465  case 'h':
466  host_data = optarg;
467  break;
468 
469  case 'p':
470  port = strtol(optarg, NULL, 10);
471  break;
472 
473  case 't':
474  fadetime = strtol(optarg, NULL, 10);
475  break;
476 
477  case 'd': {
478  if (!host_data) {
479  usage(argv);
480  exit(1);
481  }
482  if (!gonnected) setup_connection(ctx);
483  dump_nodes_state(ctx);
484  break;
485  }
486 
487  case 'w': {
488  int tme = strtol(optarg, NULL, 10);
489  struct timespec ts;
490  ts.tv_sec = tme / 10;
491  ts.tv_nsec = (tme % 10 ) * 100 * 1000 * 1000;
492  while (1) {
493  if (0 == nanosleep(&ts,&ts)) break;
494  if (errno != EINTR) break;
495  }
496  }
497  break;
498 
499  case 2: {
500  if (!gonnected) setup_connection(ctx);
501  dump_groups(ctx);
502  break;
503  }
504 
505  case 'g': {
506  if (!gonnected) setup_connection(ctx);
507  group_data = optarg;
508  name_data = NULL;
509  break;
510  }
511 
512  case 'u': {
513  if (!gonnected || !name_data) { usage(argv); exit(1); }
514  command_update_node(ctx);
515  break;
516  }
517 
518  case 0:
519  break;
520  case 1:
521  break;
522 
523  default:
524  //printf("unknown option %c %d", c, c);
525  usage(argv);
526  exit(1);
527  }
528  }
529 
530  return 0;
531 }
usage
void usage(char *argv[])
Definition: lightify-util.c:105
command_update_node
void command_update_node(struct lightify_ctx *ctx)
Definition: lightify-util.c:237
lightify_node_get_lamptype
enum lightify_node_type lightify_node_get_lamptype(struct lightify_node *node)
Definition: node.c:208
lightify_node_request_onoff
LIGHTIFY_EXPORT int lightify_node_request_onoff(struct lightify_ctx *ctx, struct lightify_node *node, int onoff)
Definition: context.c:922
find_node_per_name
struct lightify_node * find_node_per_name(struct lightify_ctx *ctx, const char *name)
Definition: lightify-util.c:126
lightify_node_get_brightness
int lightify_node_get_brightness(struct lightify_node *node)
Definition: node.c:274
err
#define err(ctx, arg...)
command_set_lvl
void command_set_lvl(struct lightify_ctx *ctx)
Definition: lightify-util.c:217
command_r
int command_r
Definition: lightify-util.c:80
main
int main(int argc, char *argv[])
Definition: lightify-util.c:391
command_l_data
int command_l_data
Definition: lightify-util.c:87
LIGHTIFY_ONOFF_PLUG
@ LIGHTIFY_ONOFF_PLUG
Definition: liblightify.h:106
LIGHTIFY_OFFLINE
@ LIGHTIFY_OFFLINE
Definition: liblightify.h:120
lightify_skt_setfd
int lightify_skt_setfd(struct lightify_ctx *ctx, int socket)
Definition: socket.c:204
LIGHTIFY_DIMABLE_LIGHT
@ LIGHTIFY_DIMABLE_LIGHT
Definition: liblightify.h:107
gonnected
int gonnected
Definition: lightify-util.c:101
lightify_group_request_brightness
LIGHTIFY_EXPORT int lightify_group_request_brightness(struct lightify_ctx *ctx, struct lightify_group *group, unsigned int level, unsigned int fadetime)
Definition: context.c:1223
lightify_node_request_scan
LIGHTIFY_EXPORT int lightify_node_request_scan(struct lightify_ctx *ctx)
Definition: context.c:505
lightify_group_request_scan
LIGHTIFY_EXPORT int lightify_group_request_scan(struct lightify_ctx *ctx)
Definition: context.c:1082
lightify_node_get_name
const char * lightify_node_get_name(struct lightify_node *node)
Definition: node.c:164
lightify_node_is_on
int lightify_node_is_on(struct lightify_node *node)
Definition: node.c:286
lightify_group
Definition: groups.c:46
find_grp_per_name
struct lightify_group * find_grp_per_name(struct lightify_ctx *ctx, const char *name)
Definition: lightify-util.c:138
port
int port
Definition: lightify-util.c:97
host_data
char * host_data
Definition: lightify-util.c:95
lightify_group_get_next_node
LIGHTIFY_EXPORT struct lightify_node * lightify_group_get_next_node(struct lightify_group *grp, struct lightify_node *lastnode)
Definition: groups.c:147
lightify_node_get_nodeadr
uint64_t lightify_node_get_nodeadr(struct lightify_node *node)
Definition: node.c:175
fadetime
int fadetime
Definition: lightify-util.c:99
lightify_node_get_grpadr
uint16_t lightify_node_get_grpadr(struct lightify_node *node)
Definition: node.c:197
command_r_w
int command_r_w
Definition: lightify-util.c:84
lightify_node_get_red
int lightify_node_get_red(struct lightify_node *node)
Definition: node.c:219
lightify_group::name
char * name
Definition: groups.c:57
lightify_node::ctx
struct lightify_ctx * ctx
Definition: node.c:46
command_cct_data
int command_cct_data
Definition: lightify-util.c:78
command_set_rgbw
void command_set_rgbw(struct lightify_ctx *ctx)
Definition: lightify-util.c:194
liblightify.h
LIGHTIFY_COLOUR_LIGHT
@ LIGHTIFY_COLOUR_LIGHT
Definition: liblightify.h:108
command_cct
int command_cct
Definition: lightify-util.c:77
LIGHTIFY_ONLINE
@ LIGHTIFY_ONLINE
Definition: liblightify.h:121
lightify_node_request_brightness
LIGHTIFY_EXPORT int lightify_node_request_brightness(struct lightify_ctx *ctx, struct lightify_node *node, unsigned int level, unsigned int fadetime)
Definition: context.c:975
lightify_node_get_green
int lightify_node_get_green(struct lightify_node *node)
Definition: node.c:241
LIGHTIFY_4WAY_SWITCH
@ LIGHTIFY_4WAY_SWITCH
Definition: liblightify.h:111
dump_groups
void dump_groups(struct lightify_ctx *ctx)
Definition: lightify-util.c:374
lightify_node
Definition: node.c:43
command_set_cct
void command_set_cct(struct lightify_ctx *ctx)
Definition: lightify-util.c:174
setup_connection
void setup_connection(struct lightify_ctx *ctx)
Definition: lightify-util.c:246
command_r_b
int command_r_b
Definition: lightify-util.c:83
command_set_0_1
void command_set_0_1(struct lightify_ctx *ctx, int command_on)
Definition: lightify-util.c:150
command_r_r
int command_r_r
Definition: lightify-util.c:81
LIGHTIFY_CCT_LIGHT
@ LIGHTIFY_CCT_LIGHT
Definition: liblightify.h:110
command_r_g
int command_r_g
Definition: lightify-util.c:82
sockfd
int sockfd
Definition: lightify-util.c:103
lightify_ctx
Definition: context.h:68
lightify_new
LIGHTIFY_EXPORT int lightify_new(struct lightify_ctx **ctx, void *reserved)
Definition: context.c:445
lightify_node_get_cct
int lightify_node_get_cct(struct lightify_node *node)
Definition: node.c:263
lightify_node_get_next
LIGHTIFY_EXPORT struct lightify_node * lightify_node_get_next(struct lightify_ctx *ctx, struct lightify_node *node)
Definition: context.c:402
lightify_group_request_cct
LIGHTIFY_EXPORT int lightify_group_request_cct(struct lightify_ctx *ctx, struct lightify_group *group, unsigned int cct, unsigned int fadetime)
Definition: context.c:1192
lightify_node_get_white
int lightify_node_get_white(struct lightify_node *node)
Definition: node.c:252
lightify_group_request_rgbw
LIGHTIFY_EXPORT 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)
Definition: context.c:1205
lightify_group_get_id
LIGHTIFY_EXPORT int lightify_group_get_id(struct lightify_group *grp)
Definition: groups.c:128
command_l
int command_l
Definition: lightify-util.c:86
decode_lamptype
const char * decode_lamptype(int type)
Definition: lightify-util.c:311
lightify_group_request_onoff
LIGHTIFY_EXPORT int lightify_group_request_onoff(struct lightify_ctx *ctx, struct lightify_group *group, int onoff)
Definition: context.c:1178
group_data
char * group_data
Definition: lightify-util.c:93
lightify_group::ctx
struct lightify_ctx * ctx
Definition: groups.c:47
decode_onoff_sate
const char * decode_onoff_sate(int state)
Definition: lightify-util.c:330
dump_nodes_state
void dump_nodes_state(struct lightify_ctx *ctx)
Definition: lightify-util.c:342
lightify_node::name
char * name
Definition: node.c:61
lightify_group_get_next
LIGHTIFY_EXPORT struct lightify_group * lightify_group_get_next(struct lightify_ctx *ctx, struct lightify_group *current)
Definition: groups.c:134
lightify_node_get_onlinestate
int lightify_node_get_onlinestate(struct lightify_node *node)
Definition: node.c:297
decode_online_state
const char * decode_online_state(int state)
Definition: lightify-util.c:300
lightify_node_request_update
LIGHTIFY_EXPORT int lightify_node_request_update(struct lightify_ctx *ctx, struct lightify_node *node)
Definition: context.c:987
lightify_node_request_rgbw
LIGHTIFY_EXPORT 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)
Definition: context.c:959
LIGHTIFY_EXT_COLOUR_LIGHT
@ LIGHTIFY_EXT_COLOUR_LIGHT
Definition: liblightify.h:109
lightify_group_get_name
const LIGHTIFY_EXPORT char * lightify_group_get_name(struct lightify_group *grp)
Definition: groups.c:117
lightify_node_is_stale
int lightify_node_is_stale(struct lightify_node *node)
Definition: node.c:302
lightify_node_request_cct
LIGHTIFY_EXPORT int lightify_node_request_cct(struct lightify_ctx *ctx, struct lightify_node *node, unsigned int cct, unsigned int fadetime)
Definition: context.c:947
name_data
char * name_data
Definition: lightify-util.c:91
lightify_node_get_blue
int lightify_node_get_blue(struct lightify_node *node)
Definition: node.c:230