Skip to content

Commit

Permalink
ui: better checking for setting in record_setting
Browse files Browse the repository at this point in the history
  • Loading branch information
pfps committed Feb 13, 2024
1 parent 745374e commit 2e44e45
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/solaar/ui/config_panel.py
Original file line number Diff line number Diff line change
Expand Up @@ -827,8 +827,10 @@ def _record_setting(device, setting_class, values):
if logger.isEnabledFor(logging.DEBUG):
logger.debug('on %s changing setting %s to %s', device, setting_class.name, values)
setting = next((s for s in device.settings if s.name == setting_class.name), None)
assert device == setting._device
if setting is None and logger.isEnabledFor(logging.DEBUG):
logger.debug('No setting for %s found on %s when trying to record a change made elsewhere', setting_class.name, device)
if setting:
assert device == setting._device
if len(values) > 1:
setting.update_key_value(values[0], values[-1])
value = {values[0]: values[-1]}
Expand Down

0 comments on commit 2e44e45

Please sign in to comment.