Skip to content

Commit

Permalink
fix: Waiting of services for reading loop
Browse files Browse the repository at this point in the history
  • Loading branch information
davidrapan committed Aug 6, 2024
1 parent 5a1d367 commit 4980b8e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion custom_components/solarman/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ async def wait_for_reading_done(self, attempts_left = ACTION_ATTEMPTS):
while self._is_reading == 1 and attempts_left > 0:
attempts_left -= 1

await asyncio.sleep(TIMINGS_WAIT_SLEEP)
await asyncio.sleep(TIMINGS_WAIT_FOR_SLEEP)

return self._is_reading == 1

Expand Down
1 change: 1 addition & 0 deletions custom_components/solarman/const.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
TIMINGS_UPDATE_TIMEOUT = TIMINGS_INTERVAL * 6
TIMINGS_SOCKET_TIMEOUT = TIMINGS_INTERVAL * 4 - 1
TIMINGS_WAIT_SLEEP = 0.2
TIMINGS_WAIT_FOR_SLEEP = 1

ATTR_FRIENDLY_NAME = "friendly_name"

Expand Down

0 comments on commit 4980b8e

Please sign in to comment.