mirror of
https://github.com/home-assistant/core.git
synced 2025-06-04 21:27:10 +00:00
Fix Lutron Pico (#27059)
* removed a nesting level * Lutron Pico fix * Reverted logging change Was unaware that f-strings aren't used in logging commands, reverted the usage * Reverted logging change Was unaware that f-strings aren't used in logging commands, reverted the usage * fixed logic
This commit is contained in:
parent
86700ec1ac
commit
a3f3ea4e25
@ -68,18 +68,19 @@ def setup(hass, base_config):
|
|||||||
hass.data[LUTRON_DEVICES]["switch"].append((area.name, output))
|
hass.data[LUTRON_DEVICES]["switch"].append((area.name, output))
|
||||||
for keypad in area.keypads:
|
for keypad in area.keypads:
|
||||||
for button in keypad.buttons:
|
for button in keypad.buttons:
|
||||||
# This is the best way to determine if a button does anything
|
# If the button has a function assigned to it, add it as a scene
|
||||||
# useful until pylutron is updated to provide information on
|
if button.name != "Unknown Button" and button.button_type in (
|
||||||
# which buttons actually control scenes.
|
"SingleAction",
|
||||||
for led in keypad.leds:
|
"Toggle",
|
||||||
if (
|
):
|
||||||
led.number == button.number
|
# Associate an LED with a button if there is one
|
||||||
and button.name != "Unknown Button"
|
led = next(
|
||||||
and button.button_type in ("SingleAction", "Toggle")
|
(led for led in keypad.leds if led.number == button.number),
|
||||||
):
|
None,
|
||||||
hass.data[LUTRON_DEVICES]["scene"].append(
|
)
|
||||||
(area.name, keypad.name, button, led)
|
hass.data[LUTRON_DEVICES]["scene"].append(
|
||||||
)
|
(area.name, keypad.name, button, led)
|
||||||
|
)
|
||||||
|
|
||||||
hass.data[LUTRON_BUTTONS].append(LutronButton(hass, keypad, button))
|
hass.data[LUTRON_BUTTONS].append(LutronButton(hass, keypad, button))
|
||||||
if area.occupancy_group is not None:
|
if area.occupancy_group is not None:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user