From ab8491fb6f1cf836944b8f614d588083472c681c Mon Sep 17 00:00:00 2001 From: jan iversen Date: Tue, 12 Sep 2023 12:56:55 +0200 Subject: [PATCH] Review. --- homeassistant/components/modbus/base_platform.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/homeassistant/components/modbus/base_platform.py b/homeassistant/components/modbus/base_platform.py index 4539a4e496c51..bbd0c35bcc042 100644 --- a/homeassistant/components/modbus/base_platform.py +++ b/homeassistant/components/modbus/base_platform.py @@ -239,7 +239,7 @@ def unpack_structure_result(self, registers: list[int]) -> str | None: v_result.append("0") elif v_temp != v_temp: # noqa: PLR0124 # NaN float detection replace with None - v_result.append("nan") + v_result.append("0") else: v_result.append(f"{float(v_temp):.{self._precision}f}") return ",".join(map(str, v_result))