fixed scene watchers

This commit is contained in:
John Lancaster
2023-11-25 22:36:41 -06:00
parent f7d8fba8fb
commit 0102321b87
2 changed files with 5 additions and 4 deletions

View File

@@ -13,9 +13,9 @@ scene_detect:
module: scene_detect
class: MotionCanceller
scene: bedsport
app: bedroom
app: bedroom_motion
scene_detect:
scene_detect2:
module: scene_detect
class: MotionCanceller
scene: in_bed

View File

@@ -1,5 +1,5 @@
from appdaemon.plugins.hass.hassapi import Hass
import asyncio
class SceneDetector(Hass):
def initialize(self):
@@ -21,5 +21,6 @@ class SceneDetector(Hass):
class MotionCanceller(SceneDetector):
async def scene_detected(self):
await super().scene_detected()
await asyncio.sleep(0.5) # needed for when the scene gets turned on from everything being off because of competing callbacks
app = await self.get_app(self.args['app'])
await app.cancel_motion_callback(new='off')