Mill, use native_value (#61382)
This commit is contained in:
parent
8c39eade5e
commit
dd6b179549
1 changed files with 4 additions and 10 deletions
|
@ -202,14 +202,8 @@ class LocalMillSensor(CoordinatorEntity, SensorEntity):
|
||||||
self._attr_name = (
|
self._attr_name = (
|
||||||
f"{coordinator.mill_data_connection.name} {entity_description.name}"
|
f"{coordinator.mill_data_connection.name} {entity_description.name}"
|
||||||
)
|
)
|
||||||
self._update_attr()
|
|
||||||
|
|
||||||
@callback
|
@property
|
||||||
def _handle_coordinator_update(self) -> None:
|
def native_value(self):
|
||||||
"""Handle updated data from the coordinator."""
|
"""Return the native value of the sensor."""
|
||||||
self._update_attr()
|
return self.coordinator.data[self.entity_description.key]
|
||||||
self.async_write_ha_state()
|
|
||||||
|
|
||||||
@callback
|
|
||||||
def _update_attr(self) -> None:
|
|
||||||
self._attr_native_value = self.coordinator.data[self.entity_description.key]
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue