sleep tweak

This commit is contained in:
John Lancaster
2023-11-25 10:18:33 -06:00
parent d34dfd2e56
commit 0b96430f7a
2 changed files with 11 additions and 14 deletions

View File

@@ -77,7 +77,6 @@ class SleepSetter(Hass, Mqtt):
def handle_button(self, event_name, data, kwargs):
topic = data['topic']
# self.log(f'Button event for: {topic}')
if (elev := self.sun_elevation) < 0:
try:
payload = json.loads(data['payload'])
action = payload['action']
@@ -88,9 +87,6 @@ class SleepSetter(Hass, Mqtt):
else:
self.handle_action(action)
else:
self.log(f'Ignoring event because sun elevation {elev} > 0')
def handle_action(self, action: str):
if action == '':
return

View File

@@ -1,13 +1,14 @@
sleep:
module: sleep
class: SleepSetter
elevation_limit: -10
# elevation_limit: -10
scene: scene.in_bed
variable: input_boolean.sleeping
button:
- Bedroom Button 1
- Bedroom Button 2
- Living Room Button
- Bathroom Button
off_apps:
- bedroom
- living_room