From 20bcb84956c7a60d9f821c723512d02557ec221d Mon Sep 17 00:00:00 2001 From: slickm0nty Date: Thu, 13 Nov 2025 16:47:40 -0600 Subject: [PATCH] Set suggested display precision in modbus integration (#155467) --- homeassistant/components/modbus/sensor.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/homeassistant/components/modbus/sensor.py b/homeassistant/components/modbus/sensor.py index 9cc3695a4cf..c1fc97e1377 100644 --- a/homeassistant/components/modbus/sensor.py +++ b/homeassistant/components/modbus/sensor.py @@ -88,6 +88,8 @@ class ModbusRegisterSensor(ModbusStructEntity, RestoreSensor, SensorEntity): self._attr_device_class = entry.get(CONF_DEVICE_CLASS) if self._precision > 0 or self._scale != int(self._scale): self._value_is_int = False + if self._precision > 0 and self._data_type not in ["string", "custom"]: + self._attr_suggested_display_precision = self._precision async def async_setup_slaves( self, hass: HomeAssistant, slave_count: int, entry: dict[str, Any]