Skip to content

Commit

Permalink
Modbus, allow received int to be a float. (#110648)
Browse files Browse the repository at this point in the history
  • Loading branch information
janiversen authored Feb 15, 2024
1 parent 1372cf5 commit 286c98d
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions homeassistant/components/modbus/base_platform.py
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,8 @@ def __init__(self, hass: HomeAssistant, hub: ModbusHub, config: dict) -> None:
self._precision = config.get(CONF_PRECISION, 2)
else:
self._precision = config.get(CONF_PRECISION, 0)
if self._precision > 0 or self._scale != int(self._scale):
self._value_is_int = False

def _swap_registers(self, registers: list[int], slave_count: int) -> list[int]:
"""Do swap as needed."""
Expand Down

0 comments on commit 286c98d

Please sign in to comment.