1
0
mirror of https://github.com/home-assistant/core.git synced 2025-12-20 02:48:57 +00:00

Set suggested display precision in modbus integration (#155467)

This commit is contained in:
slickm0nty
2025-11-13 16:47:40 -06:00
committed by GitHub
parent bbb1d57081
commit 20bcb84956

View File

@@ -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]