Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Solve wrong return code from modbus. #94234

Merged
merged 1 commit into from
Jun 8, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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