void JsonApiHandlerWS::processSetState(Params &jsonReq, const string &client_id)
{
    bool res = decodeSetState(jsonReq);

    if (!client_id.empty())
    {
        json_t *jret = json_object();
        json_object_set_new(jret, "success", json_string(res?"true":"false"));
        sendJson("set_state", jret, client_id);
    }
}
void JsonApiHandlerHttp::processSetState()
{
    json_t *jret = json_object();
    json_object_set_new(jret, "success", json_string(decodeSetState(jsonParam)?"true":"false"));
    sendJson(jret);
}