airfresher

This commit is contained in:
monster
2019-01-09 01:47:33 +03:00
parent 88c68449be
commit 9b63b82b86
19 changed files with 129 additions and 682 deletions
@@ -4,7 +4,7 @@ import globals
class KitchenLedController(hass.Hass):
listen_event_handle_list = []
def initialize(self):
if not globals.check_args(self,['watch_entity']):
if not globals.check_args(self,['watch_entity', 'topic']):
return
self.listen_event_handle_list.append(self.listen_state(self.entity_changed, self.args['watch_entity']))
@@ -15,4 +15,4 @@ class KitchenLedController(hass.Hass):
stete = "off"
if new == "on":
stete = "on"
self.call_service("mqtt/publish", topic = "home/kitchen-led/kitchen-led/state/set", payload = stete)
self.call_service("mqtt/publish", topic = self.args['topic'], payload = stete)