Added support to report back to HA via MQTT when a Scene is executed, so that following device_automations gets executed.
This will make Plejd Scene execution behave the same from Plejd App, Plejd Hardware and Home Assistant Scene triggered - in the eyes of Home Assistant
This commit is contained in:
parent
9cf3b3bdd6
commit
93eca16639
1 changed files with 9 additions and 0 deletions
|
|
@ -76,6 +76,15 @@ class PlejdAddon extends EventEmitter {
|
|||
// we're triggering a scene, lets do that and jump out.
|
||||
// since scenes aren't "real" devices.
|
||||
this.sceneManager.executeScene(uniqueId);
|
||||
|
||||
// since the scene doesn't get any updates on whether it's executed or not,
|
||||
// we fake this by directly send the sceneTriggered back to HA in order for
|
||||
// it continue to acto on the scene (for non-plejd devices).
|
||||
try {
|
||||
this.mqttClient.sceneTriggered(uniqueId);
|
||||
} catch (err) {
|
||||
logger.error('Error in PlejdService.sceneTriggered callback', err);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue