solaar: fix bad entries in divert-keys when found

This commit is contained in:
Peter F. Patel-Schneider 2022-10-03 08:34:50 -04:00
parent 193e280e87
commit be81013704
1 changed files with 2 additions and 0 deletions

View File

@ -146,6 +146,8 @@ def _cleanup_load(c):
if gestures: # convert old-style mouse-gestures setting to divert-keys entry if gestures: # convert old-style mouse-gestures setting to divert-keys entry
divert[int(gestures)] = 2 divert[int(gestures)] = 2
element.pop('mouse-gestures', None) element.pop('mouse-gestures', None)
# remove any string entries (from bad conversions)
element['divert-keys'] = {k: v for k, v in divert.items() if isinstance(k, int)}
# convert to device entries # convert to device entries
element = _DeviceEntry(**element) element = _DeviceEntry(**element)
_config.append(element) _config.append(element)