mirror of
https://github.com/home-assistant/core.git
synced 2025-07-18 18:57:06 +00:00
Mill, use native_value (#61382)
This commit is contained in:
parent
8c39eade5e
commit
dd6b179549
@ -202,14 +202,8 @@ class LocalMillSensor(CoordinatorEntity, SensorEntity):
|
||||
self._attr_name = (
|
||||
f"{coordinator.mill_data_connection.name} {entity_description.name}"
|
||||
)
|
||||
self._update_attr()
|
||||
|
||||
@callback
|
||||
def _handle_coordinator_update(self) -> None:
|
||||
"""Handle updated data from the coordinator."""
|
||||
self._update_attr()
|
||||
self.async_write_ha_state()
|
||||
|
||||
@callback
|
||||
def _update_attr(self) -> None:
|
||||
self._attr_native_value = self.coordinator.data[self.entity_description.key]
|
||||
@property
|
||||
def native_value(self):
|
||||
"""Return the native value of the sensor."""
|
||||
return self.coordinator.data[self.entity_description.key]
|
||||
|
Loading…
x
Reference in New Issue
Block a user