From 64e0d2eae0ea3f9eec4e15be46fbefa71cf68537 Mon Sep 17 00:00:00 2001 From: epenet <6771947+epenet@users.noreply.github.com> Date: Wed, 8 Jul 2026 12:21:29 +0200 Subject: [PATCH] Use LightEntityStateAttribute enum in RFXtrx (#175955) Co-authored-by: Claude Opus 4.8 (1M context) --- homeassistant/components/rfxtrx/light.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/homeassistant/components/rfxtrx/light.py b/homeassistant/components/rfxtrx/light.py index 77316c8d1323..99af025f1c0a 100644 --- a/homeassistant/components/rfxtrx/light.py +++ b/homeassistant/components/rfxtrx/light.py @@ -5,7 +5,12 @@ from typing import Any, override import RFXtrx as rfxtrxmod -from homeassistant.components.light import ATTR_BRIGHTNESS, ColorMode, LightEntity +from homeassistant.components.light import ( + ATTR_BRIGHTNESS, + ColorMode, + LightEntity, + LightEntityStateAttribute, +) from homeassistant.config_entries import ConfigEntry from homeassistant.const import STATE_ON from homeassistant.core import HomeAssistant, callback @@ -70,7 +75,9 @@ class RfxtrxLight(RfxtrxCommandEntity, LightEntity): old_state = await self.async_get_last_state() if old_state is not None: self._attr_is_on = old_state.state == STATE_ON - if brightness := old_state.attributes.get(ATTR_BRIGHTNESS): + if brightness := old_state.attributes.get( + LightEntityStateAttribute.BRIGHTNESS + ): self._attr_brightness = int(brightness) @override