Skip to content

Commit

Permalink
fix: Do rediscovery only once
Browse files Browse the repository at this point in the history
  • Loading branch information
davidrapan committed Dec 27, 2024
1 parent f9192eb commit de59e8e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions custom_components/solarman/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,8 @@ async def try_read_write(self, code, start, arg, message: str, incremental_wait:
except Exception as e:
_LOGGER.debug(f"[{self.config.serial}] {message} failed, attempts left: {attempts_left}{'' if attempts_left > 0 else ', aborting.'} [{format_exception(e)}]")

await self.endpoint.discover(True)

if attempts_left == ACTION_ATTEMPTS - 2:
await self.endpoint.discover(True)
if not self.modbus.auto_reconnect:
await self.modbus.disconnect()
if not attempts_left > 0:
Expand Down

0 comments on commit de59e8e

Please sign in to comment.