Disable unsupported advanced led controls

This commit is contained in:
Stephen Horvath
2025-09-08 19:02:41 +10:00
parent 923c06a3f1
commit f50a11deaa

View File

@@ -104,9 +104,12 @@ class LedsPage(Gtk.Box):
if supported_colours[i]: if supported_colours[i]:
strings.append(colour) strings.append(colour)
try:
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
) )
except ec_exceptions.ECError as e:
self.led_pwr_colour.set_sensitive(False)
def handle_led_colour(combobox, led_id): def handle_led_colour(combobox, led_id):
colour = combobox.get_selected() - 2 colour = combobox.get_selected() - 2
@@ -141,10 +144,13 @@ class LedsPage(Gtk.Box):
# Advanced: Charging LED # Advanced: Charging LED
led_chg_colour_strings = self.led_chg_colour.get_model() led_chg_colour_strings = self.led_chg_colour.get_model()
try:
add_colours( add_colours(
led_chg_colour_strings, led_chg_colour_strings,
ec_commands.leds.EcLedId.EC_LED_ID_BATTERY_LED, ec_commands.leds.EcLedId.EC_LED_ID_BATTERY_LED,
) )
except ec_exceptions.ECError as e:
self.led_chg_colour.set_sensitive(False)
self.led_chg_colour.connect( self.led_chg_colour.connect(
"notify::selected", "notify::selected",