Use identity check for ESPHome sensor device_class (#121828)
This commit is contained in:
parent
df8c949884
commit
76d6a1fe13
1 changed files with 1 additions and 1 deletions
|
@ -99,7 +99,7 @@ class EsphomeSensor(EsphomeEntity[SensorInfo, SensorState], SensorEntity):
|
|||
state = self._state
|
||||
if state.missing_state or not math.isfinite(state.state):
|
||||
return None
|
||||
if self._attr_device_class == SensorDeviceClass.TIMESTAMP:
|
||||
if self._attr_device_class is SensorDeviceClass.TIMESTAMP:
|
||||
return dt_util.utc_from_timestamp(state.state)
|
||||
return f"{state.state:.{self._static_info.accuracy_decimals}f}"
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue