From 8d847aa7604c83e4de9b245b9b7798d13dd39e1e Mon Sep 17 00:00:00 2001 From: Gazoodle Date: Fri, 4 Feb 2022 19:23:33 +0000 Subject: [PATCH] Fast locate for static IP --- README.md | 1 + src/geckolib/locator.py | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index b3d6dc0..7b967aa 100644 --- a/README.md +++ b/README.md @@ -323,6 +323,7 @@ https://www.gnu.org/licenses/gpl-3.0.html - Increase connection timeout to help with laggy tubs and busy networks - Watercare setting updated locally rather than wait for tub response to improve HA UI responsiveness + - Fast locator for static IP ## Done/Fixed in 0.3.21 - Demoted some benign debugging data that clutters log files diff --git a/src/geckolib/locator.py b/src/geckolib/locator.py index 6809ed3..8a65250 100644 --- a/src/geckolib/locator.py +++ b/src/geckolib/locator.py @@ -69,6 +69,8 @@ def _on_discovered(self, handler, socket, sender): self._has_found_spa = True if descriptor.identifier == self._spa_to_find: self._has_found_spa = True + if self._static_ip is not None: + self._has_found_spa = True @property def age(self): @@ -114,7 +116,9 @@ def _retry_thread_func(self): if self.age < GeckoConstants.DISCOVERY_TIMEOUT_IN_SECONDS: self._socket.queue_send( GeckoHelloProtocolHandler.broadcast(), - GeckoHelloProtocolHandler.broadcast_address(static_ip=self._static_ip), + GeckoHelloProtocolHandler.broadcast_address( + static_ip=self._static_ip + ), ) self._socket.wait(1) logger.debug("Locator retry thread stopped")