mirror of
https://github.com/home-assistant/core.git
synced 2025-07-25 22:27:07 +00:00
Fix Flexit mypy error in pymodbus (#97799)
This commit is contained in:
parent
50da5c3fae
commit
f0abea48a6
@ -177,9 +177,7 @@ class Flexit(ClimateEntity):
|
|||||||
self, register_type: str, register: int
|
self, register_type: str, register: int
|
||||||
) -> int:
|
) -> int:
|
||||||
"""Read register using the Modbus hub slave."""
|
"""Read register using the Modbus hub slave."""
|
||||||
result = await self._hub.async_pymodbus_call(
|
result = await self._hub.async_pb_call(self._slave, register, 1, register_type)
|
||||||
self._slave, register, 1, register_type
|
|
||||||
)
|
|
||||||
if result is None:
|
if result is None:
|
||||||
_LOGGER.error("Error reading value from Flexit modbus adapter")
|
_LOGGER.error("Error reading value from Flexit modbus adapter")
|
||||||
return -1
|
return -1
|
||||||
@ -197,7 +195,7 @@ class Flexit(ClimateEntity):
|
|||||||
return result / 10.0
|
return result / 10.0
|
||||||
|
|
||||||
async def _async_write_int16_to_register(self, register: int, value: int) -> bool:
|
async def _async_write_int16_to_register(self, register: int, value: int) -> bool:
|
||||||
result = await self._hub.async_pymodbus_call(
|
result = await self._hub.async_pb_call(
|
||||||
self._slave, register, value, CALL_TYPE_WRITE_REGISTER
|
self._slave, register, value, CALL_TYPE_WRITE_REGISTER
|
||||||
)
|
)
|
||||||
if not result:
|
if not result:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user