Simplify code, due to better error catching in modbus. (#100483)

This commit is contained in:
jan iversen 2023-09-16 13:49:37 +02:00 committed by GitHub
parent 30d604c851
commit 48dc81eff0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 2 additions and 15 deletions

View file

@ -247,10 +247,6 @@ class ModbusThermostat(BaseStructPlatform, RestoreEntity, ClimateEntity):
# remark "now" is a dummy parameter to avoid problems with
# async_track_time_interval
# do not allow multiple active calls to the same platform
if self._call_active:
return
self._call_active = True
self._attr_target_temperature = await self._async_read_register(
CALL_TYPE_REGISTER_HOLDING, self._target_temperature_register
)
@ -282,7 +278,6 @@ class ModbusThermostat(BaseStructPlatform, RestoreEntity, ClimateEntity):
if onoff == 0:
self._attr_hvac_mode = HVACMode.OFF
self._call_active = False
self.async_write_ha_state()
async def _async_read_register(