Skip to content

Commit

Permalink
fix: Try discovery broadcast on all interfaces only once
Browse files Browse the repository at this point in the history
  • Loading branch information
davidrapan committed Dec 27, 2024
1 parent e4ad4cb commit f9192eb
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions custom_components/solarman/discovery.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,14 +74,14 @@ async def discover(self, ping_only = False):
self._devices = {}

if self._ip:
_LOGGER.debug(f"_discover_all: Broadcasting on {self._ip}")
_LOGGER.debug(f"_discover: Broadcasting on {self._ip}")
self._devices = {item[0]: item[1] async for item in self._discover(self._ip)}
if len(self._devices) > 0 and not self._serial in self._devices:
self._devices = {}
if ping_only:
return self._devices

attempts_left = ACTION_ATTEMPTS
attempts_left = 1
while len(self._devices) == 0 and attempts_left > 0:
attempts_left -= 1

Expand Down

0 comments on commit f9192eb

Please sign in to comment.