airfresher
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -5,5 +5,17 @@ kitchen_led_controller:
|
||||
module: kitchen_led_controller
|
||||
class: KitchenLedController
|
||||
watch_entity: light.kitchen
|
||||
topic: home/kitchen-led/kitchen-led/state/set
|
||||
global_dependencies:
|
||||
- globals
|
||||
|
||||
#################################
|
||||
# LIGHT BUTTONS #
|
||||
#################################
|
||||
kitchen_mini_light_controller:
|
||||
module: kitchen_led_controller
|
||||
class: KitchenLedController
|
||||
watch_entity: light.kitchen
|
||||
topic: home/plug/kitchen-mini-light/status/set
|
||||
global_dependencies:
|
||||
- globals
|
||||
|
||||
Reference in New Issue
Block a user