async working...?

This commit is contained in:
John Lancaster
2023-11-25 17:37:47 -06:00
parent c9cc841d58
commit a00f10a967
4 changed files with 133 additions and 101 deletions

12
door.py
View File

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