mirror of
https://github.com/Steve-Tech/YAFI.git
synced 2026-04-19 16:50:36 +00:00
Fix led colours being added multiple times
This commit is contained in:
14
yafi/leds.py
14
yafi/leds.py
@@ -95,12 +95,14 @@ class LedsPage(Gtk.Box):
|
|||||||
all_colours = ["Red", "Green", "Blue", "Yellow", "White", "Amber"]
|
all_colours = ["Red", "Green", "Blue", "Yellow", "White", "Amber"]
|
||||||
|
|
||||||
def add_colours(strings, led_id):
|
def add_colours(strings, led_id):
|
||||||
supported_colours = ec_commands.leds.led_control_get_max_values(
|
# Auto and Off should already be present
|
||||||
app.cros_ec, led_id
|
if strings.get_n_items() <= 2:
|
||||||
)
|
supported_colours = ec_commands.leds.led_control_get_max_values(
|
||||||
for i, colour in enumerate(all_colours):
|
app.cros_ec, led_id
|
||||||
if supported_colours[i]:
|
)
|
||||||
strings.append(colour)
|
for i, colour in enumerate(all_colours):
|
||||||
|
if supported_colours[i]:
|
||||||
|
strings.append(colour)
|
||||||
|
|
||||||
add_colours(
|
add_colours(
|
||||||
led_pwr_colour_strings, ec_commands.leds.EcLedId.EC_LED_ID_POWER_LED
|
led_pwr_colour_strings, ec_commands.leds.EcLedId.EC_LED_ID_POWER_LED
|
||||||
|
|||||||
Reference in New Issue
Block a user