Skip to content

Commit

Permalink
Solve wrong return code from modbus. (#94234)
Browse files Browse the repository at this point in the history
  • Loading branch information
janiversen authored and balloob committed Jun 8, 2023
1 parent 0cf3825 commit 2b1c45c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions homeassistant/components/flexit/climate.py
Original file line number Diff line number Diff line change
Expand Up @@ -192,14 +192,14 @@ async def _async_read_temp_from_register(
result = float(
await self._async_read_int16_from_register(register_type, register)
)
if result == -1:
if not result:
return -1
return result / 10.0

async def _async_write_int16_to_register(self, register: int, value: int) -> bool:
result = await self._hub.async_pymodbus_call(
self._slave, register, value, CALL_TYPE_WRITE_REGISTER
)
if result == -1:
if not result:
return False
return True

0 comments on commit 2b1c45c

Please sign in to comment.