From 0be0e22e7629466ea2a8ee74ed8b49da2637232b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Fri, 27 Jun 2025 16:59:10 +0000 Subject: [PATCH] Simplify rflink dimmable set_level parsing (#147636) --- homeassistant/components/rflink/light.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/homeassistant/components/rflink/light.py b/homeassistant/components/rflink/light.py index af8d2c76844..7eb53433d88 100644 --- a/homeassistant/components/rflink/light.py +++ b/homeassistant/components/rflink/light.py @@ -221,8 +221,8 @@ class DimmableRflinkLight(SwitchableRflinkDevice, LightEntity): elif command in ["off", "alloff"]: self._state = False # dimmable device accept 'set_level=(0-15)' commands - elif re.search("^set_level=(0?[0-9]|1[0-5])$", command, re.IGNORECASE): - self._brightness = rflink_to_brightness(int(command.split("=")[1])) + elif match := re.search("^set_level=(0?[0-9]|1[0-5])$", command, re.IGNORECASE): + self._brightness = rflink_to_brightness(int(match.group(1))) self._state = True @property