From f9192ebb142f15adf8ada9afcd6c6fc0d2259dd3 Mon Sep 17 00:00:00 2001 From: David Rapan Date: Fri, 27 Dec 2024 14:57:57 +0100 Subject: [PATCH] fix: Try discovery broadcast on all interfaces only once --- custom_components/solarman/discovery.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/custom_components/solarman/discovery.py b/custom_components/solarman/discovery.py index af1bab2..7eb92e7 100644 --- a/custom_components/solarman/discovery.py +++ b/custom_components/solarman/discovery.py @@ -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