more changes for dictionary unpacking

This commit is contained in:
John Lancaster
2024-08-27 19:14:26 -05:00
parent a8e0b53c53
commit 4114fb4c54
8 changed files with 26 additions and 386 deletions

View File

@@ -17,11 +17,11 @@ class Patio(Hass):
def light(self) -> Entity:
return self.get_entity(self.args['light'])
def handle_door_open(self, entity: str, attribute: str, old: str, new: str, kwargs: dict):
def handle_door_open(self, entity: str, attribute: str, old: str, new: str, **kwargs):
self.log('Door open')
if self.AD.sched.location.solar_elevation() <= 0:
self.light.turn_on(**self.args['state'])
def handle_door_close(self, entity: str, attribute: str, old: str, new: str, kwargs: dict):
def handle_door_close(self, entity: str, attribute: str, old: str, new: str, **kwargs):
self.log('Door close')
self.run_in(callback=lambda *args: self.light.turn_off(), delay=30.0)