mirror of https://github.com/nymea/nymea.git
add some status to executeaction
parent
18fc920f71
commit
e40752aa8e
|
|
@ -146,10 +146,15 @@ void JsonRPCServer::handleActionMessage(int clientId, int commandId, const QStri
|
|||
Action action(deviceId);
|
||||
action.setParams(actionParams);
|
||||
|
||||
HiveCore::instance()->deviceManager()->executeAction(action);
|
||||
|
||||
sendResponse(clientId, commandId);
|
||||
|
||||
DeviceManager::DeviceError error = HiveCore::instance()->deviceManager()->executeAction(action);
|
||||
switch (error) {
|
||||
case DeviceManager::DeviceErrorNoError:
|
||||
sendResponse(clientId, commandId);
|
||||
break;
|
||||
case DeviceManager::DeviceErrorDeviceNotFound:
|
||||
sendErrorResponse(clientId, commandId, "No such device");
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue