mirror of https://github.com/nymea/nymea.git
mumbi small changes
parent
7a87dc7696
commit
d647e8b215
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -134,6 +134,8 @@ QList<DeviceClass> 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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in New Issue