mirror of
https://github.com/home-assistant/core.git
synced 2025-07-22 12:47:08 +00:00
Modbus, allow received int to be a float. (#110648)
This commit is contained in:
parent
1372cf5a18
commit
286c98d70f
@ -199,6 +199,8 @@ class BaseStructPlatform(BasePlatform, RestoreEntity):
|
||||
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."""
|
||||
|
Loading…
x
Reference in New Issue
Block a user