mirror of
https://github.com/Steve-Tech/YAFI.git
synced 2026-04-19 16:50:36 +00:00
Disable unsupported advanced led controls
This commit is contained in:
20
yafi/leds.py
20
yafi/leds.py
@@ -104,9 +104,12 @@ class LedsPage(Gtk.Box):
|
|||||||
if supported_colours[i]:
|
if supported_colours[i]:
|
||||||
strings.append(colour)
|
strings.append(colour)
|
||||||
|
|
||||||
add_colours(
|
try:
|
||||||
led_pwr_colour_strings, ec_commands.leds.EcLedId.EC_LED_ID_POWER_LED
|
add_colours(
|
||||||
)
|
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()
|
||||||
|
|
||||||
add_colours(
|
try:
|
||||||
led_chg_colour_strings,
|
add_colours(
|
||||||
ec_commands.leds.EcLedId.EC_LED_ID_BATTERY_LED,
|
led_chg_colour_strings,
|
||||||
)
|
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",
|
||||||
|
|||||||
Reference in New Issue
Block a user