diff --git a/libhive/devicemanager.cpp b/libhive/devicemanager.cpp index 5657de1c..43e04af1 100644 --- a/libhive/devicemanager.cpp +++ b/libhive/devicemanager.cpp @@ -110,7 +110,9 @@ Trigger DeviceManager::findTrigger(const QUuid &triggerId) Action DeviceManager::findAction(const QUuid &actionId) { foreach (Device *device, m_configuredDevices) { + qDebug() << "got action" << actionId; foreach (const Action &action, device->actions()) { + qDebug() << "got action" << action.id() << actionId; if (action.id() == actionId) { return action; } diff --git a/plugins/deviceplugins/rfremotemumbi/rfremotemumbi.cpp b/plugins/deviceplugins/rfremotemumbi/rfremotemumbi.cpp index 7dfe3f44..ee6699a8 100644 --- a/plugins/deviceplugins/rfremotemumbi/rfremotemumbi.cpp +++ b/plugins/deviceplugins/rfremotemumbi/rfremotemumbi.cpp @@ -134,6 +134,8 @@ QList RfRemoteMumbi::supportedDevices() const powerAction.setName("power"); powerAction.setParameters(paramsSwitch); switchActions.append(powerAction); + + deviceClassRfSwitchMumbi.setActions(switchActions); ret.append(deviceClassRfSwitchMumbi); return ret; } @@ -209,12 +211,12 @@ void RfRemoteMumbi::executeAction(Device *device, const Action &action) }else{ binCode.append("01"); } -// // Power -// if(action.params().value().toBool()){ -// binCode.append("0001"); -// }else{ -// binCode.append("0100"); -// } + // Power + if(action.params().first().toBool()){ + binCode.append("0001"); + }else{ + binCode.append("0100"); + } // ======================================= //create rawData timings list diff --git a/tests/addconfigureddevice.sh b/tests/addconfigureddevice.sh index bd322b92..69a17920 100755 --- a/tests/addconfigureddevice.sh +++ b/tests/addconfigureddevice.sh @@ -4,5 +4,6 @@ if [ -z $1 ]; then echo "usage $0 host" else - (echo '{"id":1, "method":"Devices.AddConfiguredDevice", "params":{"deviceClass": "{d85c1ef4-197c-4053-8e40-707aa671d302}", "deviceParams":{"channel1":"false", "channel2":"false", "channel3":"false", "channel4": "false", "channel5":"false" }}}'; sleep 1) | nc $1 1234 +# (echo '{"id":1, "method":"Devices.AddConfiguredDevice", "params":{"deviceClass": "{d85c1ef4-197c-4053-8e40-707aa671d302}","deviceParams":{"channel1":"false", "channel2":"false", "channel3":"false", "channel4": "false", "channel5":"false" }}}'; sleep 1) | nc $1 1234 + (echo '{"id":1, "method":"Devices.AddConfiguredDevice", "params":{"deviceClass": "{308ae6e6-38b3-4b3a-a513-3199da2764f8}","deviceParams":{"channel1":"false","channel2":"false", "channel3":"false", "channel4": "false","channel5":"false","A":"false","B":"true","C":"false","D":"false","E":"false" }}}'; sleep 1) | nc $1 1234 fi diff --git a/tests/addrule.sh b/tests/addrule.sh index 6c57de7a..5292f58e 100755 --- a/tests/addrule.sh +++ b/tests/addrule.sh @@ -3,5 +3,5 @@ if test -z $3; then echo "usage: $1 host triggerId actionId" else - (echo '{"id":1, "method":"Rules.AddRule", "params":{"triggerId": "$2", "actionId":"$3" }}'; sleep 1) | nc $1 1234 + (echo '{"id":1, "method":"Rules.AddRule", "params":{"triggerId": "'$2'", "actionId": "'$3'" }}'; sleep 1) | nc $1 1234 fi