Files
room_control/door.py
John Lancaster a00f10a967 async working...?
2023-11-25 17:37:47 -06:00

12 lines
404 B
Python

from appdaemon.plugins.hass.hassapi import Hass
from room_control import RoomController
class Door(Hass):
async def initialize(self):
await self.listen_state(self.door_open, entity_id=self.args['door'], new='on')
async def door_open(self, entity, attribute, old, new, kwargs):
app: RoomController = await self.get_app(self.args['app'])
await app.activate_all_off()