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:
@@ -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]
|
||||
|
||||
Reference in New Issue
Block a user