mirror of
https://github.com/home-assistant/core.git
synced 2025-07-13 16:27:08 +00:00
Simplify rflink dimmable set_level parsing (#147636)
This commit is contained in:
parent
b8500b338a
commit
0be0e22e76
@ -221,8 +221,8 @@ class DimmableRflinkLight(SwitchableRflinkDevice, LightEntity):
|
|||||||
elif command in ["off", "alloff"]:
|
elif command in ["off", "alloff"]:
|
||||||
self._state = False
|
self._state = False
|
||||||
# dimmable device accept 'set_level=(0-15)' commands
|
# dimmable device accept 'set_level=(0-15)' commands
|
||||||
elif re.search("^set_level=(0?[0-9]|1[0-5])$", command, re.IGNORECASE):
|
elif match := re.search("^set_level=(0?[0-9]|1[0-5])$", command, re.IGNORECASE):
|
||||||
self._brightness = rflink_to_brightness(int(command.split("=")[1]))
|
self._brightness = rflink_to_brightness(int(match.group(1)))
|
||||||
self._state = True
|
self._state = True
|
||||||
|
|
||||||
@property
|
@property
|
||||||
|
Loading…
x
Reference in New Issue
Block a user