From ca79d371352d347daa4d9946ef74973aa8cd900f Mon Sep 17 00:00:00 2001 From: Maciej Bieniek Date: Wed, 19 Nov 2025 16:06:11 +0100 Subject: [PATCH] Use `native_value` property instead of `_attr_native_value` in the Brother integration (#156878) --- homeassistant/components/brother/sensor.py | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/homeassistant/components/brother/sensor.py b/homeassistant/components/brother/sensor.py index 873e734b1d6..dda4231dd30 100644 --- a/homeassistant/components/brother/sensor.py +++ b/homeassistant/components/brother/sensor.py @@ -17,7 +17,7 @@ from homeassistant.components.sensor import ( SensorStateClass, ) from homeassistant.const import PERCENTAGE, EntityCategory -from homeassistant.core import HomeAssistant, callback +from homeassistant.core import HomeAssistant from homeassistant.helpers import entity_registry as er from homeassistant.helpers.entity_platform import AddConfigEntryEntitiesCallback from homeassistant.helpers.typing import StateType @@ -345,12 +345,10 @@ class BrotherPrinterSensor(BrotherPrinterEntity, SensorEntity): """Initialize.""" super().__init__(coordinator) - self._attr_native_value = description.value(coordinator.data) self._attr_unique_id = f"{coordinator.brother.serial.lower()}_{description.key}" self.entity_description = description - @callback - def _handle_coordinator_update(self) -> None: - """Handle updated data from the coordinator.""" - self._attr_native_value = self.entity_description.value(self.coordinator.data) - self.async_write_ha_state() + @property + def native_value(self) -> StateType | datetime: + """Return the native value of the sensor.""" + return self.entity_description.value(self.coordinator.data)