diff --git a/custom_components/solarman/api.py b/custom_components/solarman/api.py index 4b73e6e..8665145 100644 --- a/custom_components/solarman/api.py +++ b/custom_components/solarman/api.py @@ -255,7 +255,7 @@ async def async_get(self, runtime = 0): if ((not isinstance(e, TimeoutError) or not attempts_left >= 1) and not (not isinstance(e, TimeoutError) or (e.__cause__ and isinstance(e.__cause__, OSError) and e.__cause__.errno == errno.EHOSTUNREACH))) or _LOGGER.isEnabledFor(logging.DEBUG): _LOGGER.warning(f"Querying ({start} - {end}) failed. #{runtime} [{format_exception(e)}]") - await asyncio.sleep(TIMINGS_QUERY_EXCEPT_SLEEP) + await asyncio.sleep(TIMINGS_WAIT_SLEEP) _LOGGER.debug(f"Querying {'succeeded.' if results[i] == 1 else f'attempts left: {attempts_left}{'' if attempts_left > 0 else ', aborting.'}'}") @@ -323,7 +323,7 @@ async def service_write_holding_register(self, register, value, wait_for_attempt if not attempts_left > 0: raise - await asyncio.sleep(TIMINGS_WRITE_EXCEPT_SLEEP) + await asyncio.sleep(TIMINGS_WRITE_SLEEP) async def service_write_multiple_holding_registers(self, register, values, wait_for_attempts = ACTION_ATTEMPTS) -> bool: _LOGGER.debug(f"service_write_multiple_holding_registers: {register}, values: {values}") @@ -348,4 +348,4 @@ async def service_write_multiple_holding_registers(self, register, values, wait_ if not attempts_left > 0: raise - await asyncio.sleep(TIMINGS_WRITE_EXCEPT_SLEEP) + await asyncio.sleep(TIMINGS_WRITE_SLEEP) diff --git a/custom_components/solarman/const.py b/custom_components/solarman/const.py index 5e4294f..19866bf 100644 --- a/custom_components/solarman/const.py +++ b/custom_components/solarman/const.py @@ -50,8 +50,7 @@ TIMINGS_UPDATE_TIMEOUT = TIMINGS_INTERVAL * 6 TIMINGS_SOCKET_TIMEOUT = TIMINGS_INTERVAL * 4 - 1 TIMINGS_WAIT_SLEEP = 1 -TIMINGS_QUERY_EXCEPT_SLEEP = 1 -TIMINGS_WRITE_EXCEPT_SLEEP = 0.2 +TIMINGS_WRITE_SLEEP = 0.2 ATTR_FRIENDLY_NAME = "friendly_name"