Skip to content

Commit

Permalink
Merge pull request #375 from WillCodeForCats/code-quality
Browse files Browse the repository at this point in the history
Timeout in refresh as DataUpdateFailed
  • Loading branch information
WillCodeForCats authored Jul 30, 2023
2 parents 2cf6941 + 2c2b16f commit f964d0d
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions custom_components/solaredge_modbus_multi/hub.py
Original file line number Diff line number Diff line change
Expand Up @@ -421,6 +421,10 @@ async def async_refresh_modbus_data(self) -> bool:
self.disconnect()
raise DataUpdateFailed(f"Connection failed: {e}")

except asyncio.TimeoutError as e:
self.disconnect()
raise DataUpdateFailed(f"Modbus timeout: {e}")

if not self._keep_modbus_open:
self.disconnect()

Expand Down

0 comments on commit f964d0d

Please sign in to comment.