From c5cab7b61194666792339ec3dc585547b45155e1 Mon Sep 17 00:00:00 2001 From: Ben Lebherz Date: Wed, 12 Aug 2020 21:37:15 +0200 Subject: [PATCH] use list instead of generator --- apps/automoli/automoli.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/apps/automoli/automoli.py b/apps/automoli/automoli.py index acb6e61..475c17d 100644 --- a/apps/automoli/automoli.py +++ b/apps/automoli/automoli.py @@ -199,17 +199,17 @@ async def initialize(self) -> None: for sensor in self.sensors["motion"]: # listen to xiaomi sensors by default - if not any((self.states["motion_on"], self.states["motion_off"])): + if not any([self.states["motion_on"], self.states["motion_off"]]): self.lg("no motion states configured - using event listener", level="DEBUG") await self.listen_event(self.motion_event, event=EVENT_MOTION_XIAOMI, entity_id=sensor) # on/off-only sensors without events on every motion - elif all((self.states["motion_on"], self.states["motion_off"])): + elif all([self.states["motion_on"], self.states["motion_off"]]): self.lg("both motion states configured - using state listener", level="DEBUG") await self.listen_state(self.motion_detected, entity=sensor, new=self.states["motion_on"]) await self.listen_state(self.motion_cleared, entity=sensor, new=self.states["motion_off"]) - # lights_off callback handles + # callback handles to switch lights off self.handles: Set[str] = set() self.args.update(