fixed scene watchers
This commit is contained in:
@@ -13,9 +13,9 @@ scene_detect:
|
|||||||
module: scene_detect
|
module: scene_detect
|
||||||
class: MotionCanceller
|
class: MotionCanceller
|
||||||
scene: bedsport
|
scene: bedsport
|
||||||
app: bedroom
|
app: bedroom_motion
|
||||||
|
|
||||||
scene_detect:
|
scene_detect2:
|
||||||
module: scene_detect
|
module: scene_detect
|
||||||
class: MotionCanceller
|
class: MotionCanceller
|
||||||
scene: in_bed
|
scene: in_bed
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
from appdaemon.plugins.hass.hassapi import Hass
|
from appdaemon.plugins.hass.hassapi import Hass
|
||||||
|
import asyncio
|
||||||
|
|
||||||
class SceneDetector(Hass):
|
class SceneDetector(Hass):
|
||||||
def initialize(self):
|
def initialize(self):
|
||||||
@@ -21,5 +21,6 @@ class SceneDetector(Hass):
|
|||||||
class MotionCanceller(SceneDetector):
|
class MotionCanceller(SceneDetector):
|
||||||
async def scene_detected(self):
|
async def scene_detected(self):
|
||||||
await super().scene_detected()
|
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'])
|
app = await self.get_app(self.args['app'])
|
||||||
await app.cancel_motion_callback(new='off')
|
await app.cancel_motion_callback(new='off')
|
||||||
Reference in New Issue
Block a user