async working...?
This commit is contained in:
12
door.py
12
door.py
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user