Untitled
unknown
plain_text
2 years ago
495 B
2
Indexable
import appdaemon.plugins.hass.hassapi as hass # # Testing Automation trigger with appdaemon vs native # class test_auto(hass.Hass): def initialize(self): self.listen_state(self.synch_lights, "light.light", new="on") self.log("trigger complete, test automation.") def synch_lights (self, entity, attribute, old, new, kwargs): was_on = self.get_state("switch.garage_light") if was_on == "off" then self.turn_on("light.switch.garage_light")
Editor is loading...