From d29b377cf1be5f7c2d265fbd8f169a433cfb41ca Mon Sep 17 00:00:00 2001 From: Fabio Manganiello Date: Sat, 30 Apr 2022 01:39:39 +0200 Subject: [PATCH] Exclude deleted lights/groups/scenes from the returned lists --- platypush/plugins/light/hue/__init__.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/platypush/plugins/light/hue/__init__.py b/platypush/plugins/light/hue/__init__.py index e75ec5b88..476026fa5 100644 --- a/platypush/plugins/light/hue/__init__.py +++ b/platypush/plugins/light/hue/__init__.py @@ -1076,17 +1076,17 @@ class LightHuePlugin(LightPlugin): assert self.bridge, self._UNINITIALIZED_BRIDGE_ERR lights = self.bridge.get_light() self.publish_entities(lights) # type: ignore - return lights + return {id: light for id, light in lights.items() if not light.get('recycle')} def _get_groups(self) -> dict: assert self.bridge, self._UNINITIALIZED_BRIDGE_ERR groups = self.bridge.get_group() or {} - return groups + return {id: group for id, group in groups.items() if not group.get('recycle')} def _get_scenes(self) -> dict: assert self.bridge, self._UNINITIALIZED_BRIDGE_ERR scenes = self.bridge.get_scene() or {} - return scenes + return {id: scene for id, scene in scenes.items() if not scene.get('recycle')} @action def status(self) -> Iterable[LightEntity]: