This commit is contained in:
@@ -301,41 +301,6 @@ struct json_object *devices_manager_to_json_object(devices_manager_t *dm, const
|
||||
|
||||
/*--------------------------------------------------------------------------*/
|
||||
|
||||
int devices_manager_set(devices_manager_t *dm, const char *capability, struct json_object *node)
|
||||
{
|
||||
#warning "TODO"
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*--------------------------------------------------------------------------*/
|
||||
|
||||
int devices_manager_set_state(devices_manager_t *dm, const char *capability, int id, bool state)
|
||||
{
|
||||
int result = -1;
|
||||
|
||||
if (capability == kOutletEntry)
|
||||
{
|
||||
result = set_outlet_state(dm, id, state);
|
||||
}
|
||||
else if (capability == kShutterEntry)
|
||||
{
|
||||
result = set_shutter_state(dm, id, state);
|
||||
}
|
||||
else if (capability == kSprinklerEntry)
|
||||
{
|
||||
result = set_sprinkler_state(dm, id, state);
|
||||
}
|
||||
|
||||
if (result == 0)
|
||||
{
|
||||
devices_manager_save(dm);
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
/*--------------------------------------------------------------------------*/
|
||||
|
||||
int devices_manager_create(devices_manager_t *dm, const char *capability, struct json_object *node)
|
||||
{
|
||||
// Sanity checks
|
||||
|
||||
Reference in New Issue
Block a user