From c2ba97fb79936b71610c5b667d8e614ebaa010a8 Mon Sep 17 00:00:00 2001 From: epenet <6771947+epenet@users.noreply.github.com> Date: Thu, 19 Feb 2026 15:49:16 +0100 Subject: [PATCH] Use shorthand attributes in futurenow light (#163523) --- homeassistant/components/futurenow/light.py | 27 ++++----------------- 1 file changed, 5 insertions(+), 22 deletions(-) diff --git a/homeassistant/components/futurenow/light.py b/homeassistant/components/futurenow/light.py index e9dcfd7a151..be15e2b2230 100644 --- a/homeassistant/components/futurenow/light.py +++ b/homeassistant/components/futurenow/light.py @@ -77,12 +77,10 @@ class FutureNowLight(LightEntity): def __init__(self, device): """Initialize the light.""" - self._name = device["name"] + self._attr_name = device["name"] self._dimmable = device["dimmable"] self._channel = device["channel"] - self._brightness = None self._last_brightness = 255 - self._state = None if device["driver"] == CONF_DRIVER_FNIP6X10AD: self._light = pyfnip.FNIP6x2adOutput( @@ -93,21 +91,6 @@ class FutureNowLight(LightEntity): device["host"], device["port"], self._channel ) - @property - def name(self): - """Return the name of the device if any.""" - return self._name - - @property - def is_on(self): - """Return true if device is on.""" - return self._state - - @property - def brightness(self): - """Return the brightness of this light between 0..255.""" - return self._brightness - @property def color_mode(self) -> ColorMode: """Return the color mode of the light.""" @@ -131,11 +114,11 @@ class FutureNowLight(LightEntity): def turn_off(self, **kwargs: Any) -> None: """Turn the light off.""" self._light.turn_off() - if self._brightness: - self._last_brightness = self._brightness + if self._attr_brightness: + self._last_brightness = self._attr_brightness def update(self) -> None: """Fetch new state data for this light.""" state = int(self._light.is_on()) - self._state = bool(state) - self._brightness = to_hass_level(state) + self._attr_is_on = bool(state) + self._attr_brightness = to_hass_level(state)