implement pressed event for tasmota switch

This commit is contained in:
Michael Zanetti 2019-09-02 14:23:33 +02:00
parent 13ce5bb748
commit 0138985112
2 changed files with 11 additions and 0 deletions

View File

@ -299,6 +299,10 @@ void DevicePluginTasmota::onPublishReceived(MqttChannel *channel, const QString
if (m_powerStateTypeMap.contains(child->deviceClassId())) {
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")) {

View File

@ -176,6 +176,13 @@
"defaultValue": false,
"writable": true
}
],
"eventTypes": [
{
"id": "1be4d6a1-475e-43bb-a47c-9063e279e78d",
"name": "pressed",
"displayName": "Pressed"
}
]
},
{