implement pressed event for tasmota switch
This commit is contained in:
parent
13ce5bb748
commit
0138985112
@ -299,6 +299,10 @@ void DevicePluginTasmota::onPublishReceived(MqttChannel *channel, const QString
|
|||||||
if (m_powerStateTypeMap.contains(child->deviceClassId())) {
|
if (m_powerStateTypeMap.contains(child->deviceClassId())) {
|
||||||
child->setStateValue(m_powerStateTypeMap.value(child->deviceClassId()), payload == "ON");
|
child->setStateValue(m_powerStateTypeMap.value(child->deviceClassId()), payload == "ON");
|
||||||
}
|
}
|
||||||
|
if (child->deviceClassId() == tasmotaSwitchDeviceClassId) {
|
||||||
|
Event event(tasmotaSwitchPressedEventTypeId, child->id());
|
||||||
|
emit emitEvent(event);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (topic.startsWith(channel->topicPrefix() + "/sonoff/STATE")) {
|
if (topic.startsWith(channel->topicPrefix() + "/sonoff/STATE")) {
|
||||||
|
|||||||
@ -176,6 +176,13 @@
|
|||||||
"defaultValue": false,
|
"defaultValue": false,
|
||||||
"writable": true
|
"writable": true
|
||||||
}
|
}
|
||||||
|
],
|
||||||
|
"eventTypes": [
|
||||||
|
{
|
||||||
|
"id": "1be4d6a1-475e-43bb-a47c-9063e279e78d",
|
||||||
|
"name": "pressed",
|
||||||
|
"displayName": "Pressed"
|
||||||
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user