Skip to content

Commit

Permalink
Fast locate for static IP
Browse files Browse the repository at this point in the history
  • Loading branch information
gazoodle committed Feb 4, 2022
1 parent 44e5903 commit 8d847aa
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 5 additions & 1 deletion src/geckolib/locator.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down Expand Up @@ -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")
Expand Down

0 comments on commit 8d847aa

Please sign in to comment.