added manual mode

This commit is contained in:
Jim Lancaster
2024-04-13 11:34:22 -05:00
parent 02726b0766
commit dc7151549b
3 changed files with 24 additions and 9 deletions

View File

@@ -54,6 +54,10 @@ class Button(Mqtt):
if action == 'single':
state = self.get_state(self.args['ref_entity'])
kwargs = {'kwargs': {'cause': f'button single click: toggle while {state}'}}
if manual_entity := self.args.get('manual_mode'):
self.set_state(entity_id=manual_entity, state='off')
if state == 'on':
self.app.deactivate(**kwargs)
else: