10#include "../nyx_node_internal.h"
18 if(label == NULL || label[0] ==
'\0')
29 nyx_dict_set_string_unref(result,
"<>",
"defLight",
false);
33 nyx_dict_set_string_unref(result,
"@name",
nyx_string_dup(name),
true);
34 nyx_dict_set_string_unref(result,
"@label",
nyx_string_dup(label),
true);
38 nyx_dict_set_string_unref(result,
"$", nyx_state_to_str(value),
false);
51 return nyx_dict_set_string(prop,
"$", nyx_state_to_str(value),
false);
58 return nyx_str_to_state(nyx_dict_get_string(prop,
"$"));
78 nyx_dict_set_string_unref(result,
"<>",
"defLightVector",
false);
82 nyx_dict_set_string_unref(result,
"@client",
"unknown",
false);
83 nyx_dict_set_string_unref(result,
"@device",
nyx_string_dup(device),
true);
84 nyx_dict_set_string_unref(result,
"@name",
nyx_string_dup(name),
true);
86 nyx_dict_set_string_unref(result,
"@state", nyx_state_to_str(state),
false);
90 internal_set_opts(result, opts);
94 nyx_dict_set(result,
"children", children);
96 if(props)
for(; *props != NULL; props++)
98 nyx_list_push(children, *props);
100 nyx_object_unref(*props);
103 nyx_object_unref(children);
116 return internal_prop_to_set_vector(vector,
"setLightVector",
"oneLight");
Struct describing a JSON dict object.
Struct describing a JSON list object.
#define STR_t
Alias for const char *.
__NYX_NULLABLE__ str_t nyx_string_dup(__NYX_NULLABLE__ STR_t s)
Similar to libc strdup.
bool nyx_light_prop_set(const nyx_dict_t *prop, nyx_state_t value)
Sets the new value of the provided property object.
nyx_state_t nyx_light_prop_get(const nyx_dict_t *prop)
Gets the value of the provided property object.
nyx_state_t
Vector state hint.
Struct describing the options for INDI / Nyx vectors.