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)
|
Action DeviceManager::findAction(const QUuid &actionId)
|
||||||
{
|
{
|
||||||
foreach (Device *device, m_configuredDevices) {
|
foreach (Device *device, m_configuredDevices) {
|
||||||
|
qDebug() << "got action" << actionId;
|
||||||
foreach (const Action &action, device->actions()) {
|
foreach (const Action &action, device->actions()) {
|
||||||
|
qDebug() << "got action" << action.id() << actionId;
|
||||||
if (action.id() == actionId) {
|
if (action.id() == actionId) {
|
||||||
return action;
|
return action;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -134,6 +134,8 @@ QList<DeviceClass> RfRemoteMumbi::supportedDevices() const
|
||||||
powerAction.setName("power");
|
powerAction.setName("power");
|
||||||
powerAction.setParameters(paramsSwitch);
|
powerAction.setParameters(paramsSwitch);
|
||||||
switchActions.append(powerAction);
|
switchActions.append(powerAction);
|
||||||
|
|
||||||
|
deviceClassRfSwitchMumbi.setActions(switchActions);
|
||||||
ret.append(deviceClassRfSwitchMumbi);
|
ret.append(deviceClassRfSwitchMumbi);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
@ -209,12 +211,12 @@ void RfRemoteMumbi::executeAction(Device *device, const Action &action)
|
||||||
}else{
|
}else{
|
||||||
binCode.append("01");
|
binCode.append("01");
|
||||||
}
|
}
|
||||||
// // Power
|
// Power
|
||||||
// if(action.params().value().toBool()){
|
if(action.params().first().toBool()){
|
||||||
// binCode.append("0001");
|
binCode.append("0001");
|
||||||
// }else{
|
}else{
|
||||||
// binCode.append("0100");
|
binCode.append("0100");
|
||||||
// }
|
}
|
||||||
|
|
||||||
// =======================================
|
// =======================================
|
||||||
//create rawData timings list
|
//create rawData timings list
|
||||||
|
|
|
||||||
|
|
@ -4,5 +4,6 @@
|
||||||
if [ -z $1 ]; then
|
if [ -z $1 ]; then
|
||||||
echo "usage $0 host"
|
echo "usage $0 host"
|
||||||
else
|
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
|
fi
|
||||||
|
|
|
||||||
|
|
@ -3,5 +3,5 @@
|
||||||
if test -z $3; then
|
if test -z $3; then
|
||||||
echo "usage: $1 host triggerId actionId"
|
echo "usage: $1 host triggerId actionId"
|
||||||
else
|
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
|
fi
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue