Skip to content

Commit

Permalink
Merge pull request #100 from gerritjanf/patch-1
Browse files Browse the repository at this point in the history
Close the connection after retrieving realtime data
  • Loading branch information
wimb0 authored Oct 28, 2024
2 parents b86e88c + 63b1001 commit 05453fc
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions custom_components/saj_modbus/hub.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,8 @@ async def _async_update_data(self) -> dict:
realtime_data = await self.hass.async_add_executor_job(
self.read_modbus_realtime_data
)

self.close()
except ConnectionException:
_LOGGER.error("Reading realtime data failed! Inverter is unreachable.")
realtime_data["mpvmode"] = 0
Expand Down

0 comments on commit 05453fc

Please sign in to comment.