add some status to executeaction

pull/1/head
Michael Zanetti 2014-01-02 21:02:43 +01:00
parent 18fc920f71
commit e40752aa8e
1 changed files with 9 additions and 4 deletions

View File

@ -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;
}
}
}