more work

This commit is contained in:
John Lancaster
2024-03-10 17:33:22 -05:00
parent e90ad5a071
commit 541475d68b
5 changed files with 93 additions and 22 deletions

10
door.py
View File

@@ -1,8 +1,14 @@
from appdaemon.plugins.hass.hassapi import Hass
from console import setup_component_logging
from room_control import RoomController
class Door(Hass):
async def initialize(self):
app: RoomController = await self.get_app(self.args['app'])
await self.listen_state(app.activate_all_off, entity_id=self.args['door'], new='on', cause='door open')
setup_component_logging(self)
self.app: RoomController = await self.get_app(self.args['app'])
self.log(f'Connected to AD app [room]{self.app.name}[/]', level='DEBUG')
await self.listen_state(self.app.activate_all_off, entity_id=self.args['door'], new='on', cause='door open')