From 63b1001c15953291cb9736f35fa3be741674ff16 Mon Sep 17 00:00:00 2001 From: gerritjanf Date: Tue, 1 Oct 2024 16:39:25 +0200 Subject: [PATCH] Close the connection --- custom_components/saj_modbus/hub.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/custom_components/saj_modbus/hub.py b/custom_components/saj_modbus/hub.py index 2c5a33d..c6a7517 100644 --- a/custom_components/saj_modbus/hub.py +++ b/custom_components/saj_modbus/hub.py @@ -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