""" trigger file.wall_buttons.hallway_wall_button got event trigger, running action (kwargs = { 'trigger_type': 'event', 'event_type': 'button_pressed', 'context': Context(user_id=None, parent_id=None, id='67d442d5b0b4c1f3308417722801f709'), 'entity_id': 'switch.hall_switch', 'state': 'on' }) kalle = kwargs.context.get("entity_id", None) ^ AttributeError: 'dict' object has no attribute 'context' """ @event_trigger( "button_pressed" , "entity_id == 'switch.hall_switch'") def hallway_wall_button(): log.info(f"**************** got EVENT_CALL_SERVICE with kwargs=") if( switch.group_button_all == 'on'): pyscript.state_goto_all_off(); else: pyscript.state_goto_all_on();