From 7346db40edb134ad1e3fc7fbd044746e34632110 Mon Sep 17 00:00:00 2001 From: Rodriguez Date: Fri, 17 Nov 2023 09:28:29 +0100 Subject: [PATCH] allow hunting multiple times --- platform/panduza_platform/core/platform_device_factory.py | 1 + .../panduza_platform/devices/panduza/server/itf_platform.py | 2 ++ 2 files changed, 3 insertions(+) diff --git a/platform/panduza_platform/core/platform_device_factory.py b/platform/panduza_platform/core/platform_device_factory.py index 85d2b7e..7407ea1 100644 --- a/platform/panduza_platform/core/platform_device_factory.py +++ b/platform/panduza_platform/core/platform_device_factory.py @@ -83,6 +83,7 @@ def get_devices_store(self): # --- async def hunt_start(self): + self.__log.info(f"HUNT NEW SESSION") keys = self.__device_templates.keys() max = len(keys) self.__hunt_iter = iter(self.__device_templates.keys()) diff --git a/platform/panduza_platform/devices/panduza/server/itf_platform.py b/platform/panduza_platform/devices/panduza/server/itf_platform.py index 54aea22..87d40b5 100644 --- a/platform/panduza_platform/devices/panduza/server/itf_platform.py +++ b/platform/panduza_platform/devices/panduza/server/itf_platform.py @@ -171,6 +171,8 @@ async def hunt_task(self): has_next = await self.platform.device_factory.hunt_next() if not has_next: break + self.hunting = False + await self._update_attribute("devices", "hunting", self.hunting) print(f"!!!!!!!!!!!!!! HUNT !!!!!!!!!!!!!!!")