File tree Expand file tree Collapse file tree 1 file changed +5
-7
lines changed
homeassistant/components/brother Expand file tree Collapse file tree 1 file changed +5
-7
lines changed Original file line number Diff line number Diff line change 1717 SensorStateClass ,
1818)
1919from homeassistant .const import PERCENTAGE , EntityCategory
20- from homeassistant .core import HomeAssistant , callback
20+ from homeassistant .core import HomeAssistant
2121from homeassistant .helpers import entity_registry as er
2222from homeassistant .helpers .entity_platform import AddConfigEntryEntitiesCallback
2323from homeassistant .helpers .typing import StateType
@@ -345,12 +345,10 @@ def __init__(
345345 """Initialize."""
346346 super ().__init__ (coordinator )
347347
348- self ._attr_native_value = description .value (coordinator .data )
349348 self ._attr_unique_id = f"{ coordinator .brother .serial .lower ()} _{ description .key } "
350349 self .entity_description = description
351350
352- @callback
353- def _handle_coordinator_update (self ) -> None :
354- """Handle updated data from the coordinator."""
355- self ._attr_native_value = self .entity_description .value (self .coordinator .data )
356- self .async_write_ha_state ()
351+ @property
352+ def native_value (self ) -> StateType | datetime :
353+ """Return the native value of the sensor."""
354+ return self .entity_description .value (self .coordinator .data )
You can’t perform that action at this time.
0 commit comments