|
@@ -15,14 +15,21 @@ trigger file.wall_buttons.hallway_wall_button got event trigger, running action
|
|
|
AttributeError: 'dict' object has no attribute 'context'
|
|
|
"""
|
|
|
|
|
|
-@event_trigger( "button_pressed" , "entity_id == 'switch.hall_switch'")
|
|
|
-def hallway_wall_button():
|
|
|
+@event_trigger( "button_pressed" )
|
|
|
+def hallway_wall_button(entity_id=None):
|
|
|
|
|
|
- log.info(f"**************** got EVENT_CALL_SERVICE with kwargs=")
|
|
|
+ log.info(f"**************** got EVENT_CALL_SERVICE with {entity_id}")
|
|
|
|
|
|
- if( switch.group_button_all == 'on'):
|
|
|
+ if( entity_id == 'switch.hall_switch' ):
|
|
|
+ if( switch.group_button_all == 'on'):
|
|
|
+ pyscript.state_goto_all_off();
|
|
|
+ else:
|
|
|
+ pyscript.state_goto_all_on();
|
|
|
+
|
|
|
+ if( entity_id == 'switch.mode_panel_1' ):
|
|
|
+ pyscript.state_goto_all_on();
|
|
|
+
|
|
|
+ if( entity_id == 'switch.mode_panel_4' ):
|
|
|
pyscript.state_goto_all_off();
|
|
|
- else:
|
|
|
- pyscript.state_goto_all_on();
|
|
|
|
|
|
|