Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

config fails to load after commit 11e7cbd #2700

Closed
noabody opened this issue Dec 4, 2024 · 7 comments · Fixed by #2712
Closed

config fails to load after commit 11e7cbd #2700

noabody opened this issue Dec 4, 2024 · 7 comments · Fixed by #2712
Labels

Comments

@noabody
Copy link

noabody commented Dec 4, 2024

solaar -d
ERROR [SolaarListener:hidraw3] solaar.configuration: failed to load from .config/solaar/config.yaml: could not determine a constructor for the tag 'tag:yaml.org,2002:python/object/apply:logitech_receiver.hidpp20_constants.SupportedFeature'
  in ".config/solaar/config.yaml", line 8, column 13

(good) config.yaml at commit 11e7cbd:

- 1.1.13-108-g11e7cbde
- _NAME: Illuminated Living-Room Keyboard K830
  _absent: [hi-res-scroll, lowres-scroll-mode, hires-smooth-invert, hires-smooth-resolution, hires-scroll-mode, scroll-ratchet, smart-shift, thumb-scroll-invert,
    thumb-scroll-mode, onboard_profiles, report_rate, report_rate_extended, pointer_speed, dpi, dpi_extended, speed-change, backlight, backlight_level,
    backlight_duration_hands_out, backlight_duration_hands_in, backlight_duration_powered, backlight-timed, led_control, led_zone_, rgb_control, rgb_zone_,
    brightness_control, per-key-lighting, reprogrammable-keys, persistent-remappable-keys, crown-smooth, divert-crown, divert-gkeys, m-key-leds, mr-key-led,
    multiplatform, change-host, sidetone, equalizer, adc_power_management]
  _battery: 4096
  _modelId: B335404C0000
  _sensitive: {hires-scroll-mode: ignore, hires-smooth-invert: ignore, hires-smooth-resolution: ignore}
  _serial: redacted
  _unitId: 424CF2B3
  _wpid: 404C
  disable-keyboard-keys: {1: false, 4: false, 8: false, 16: false}
  divert-keys: {1: 0, 2: 0, 3: 0, 4: 0, 5: 0, 6: 0, 8: 0, 34: 0, 40: 0, 62: 0, 64: 0, 79: 0, 84: 0, 110: 0, 145: 0, 183: 0, 184: 0}
  fn-swap: false
  gesture2-divert: {1: false, 2: false, 10: false, 44: false, 64: false, 65: false, 67: false, 84: false, 85: false, 100: false}
  gesture2-gestures: {1: true, 2: true, 10: true, 30: true, 34: false, 42: true, 43: true, 45: false, 64: false, 65: false, 67: false, 84: true}
  gesture2-params:
    4: {scale: 256}

(bad) config.yaml at commit 0cd9c0c:

- 1.1.13-109-g0cd9c0c9
- _NAME: Illuminated Living-Room Keyboard K830
  _absent: [hi-res-scroll, lowres-scroll-mode, hires-smooth-invert, hires-smooth-resolution, hires-scroll-mode, scroll-ratchet, smart-shift, thumb-scroll-invert,
    thumb-scroll-mode, onboard_profiles, report_rate, report_rate_extended, pointer_speed, dpi, dpi_extended, speed-change, backlight, backlight_level,
    backlight_duration_hands_out, backlight_duration_hands_in, backlight_duration_powered, backlight-timed, led_control, led_zone_, rgb_control, rgb_zone_,
    brightness_control, per-key-lighting, reprogrammable-keys, persistent-remappable-keys, crown-smooth, divert-crown, divert-gkeys, m-key-leds, mr-key-led,
    multiplatform, change-host, sidetone, equalizer, adc_power_management]
  _battery: !!python/object/apply:logitech_receiver.hidpp20_constants.SupportedFeature [4096]
  _modelId: B335404C0000
  _sensitive: {hires-scroll-mode: ignore, hires-smooth-invert: ignore, hires-smooth-resolution: ignore}
  _serial: redacted
  _unitId: 424CF2B3
  _wpid: 404C
  disable-keyboard-keys: {1: false, 4: false, 8: false, 16: false}
  divert-keys: {1: 0, 2: 0, 3: 0, 4: 0, 5: 0, 6: 0, 8: 0, 34: 0, 40: 0, 62: 0, 64: 0, 79: 0, 84: 0, 110: 0, 145: 0, 183: 0, 184: 0}
  fn-swap: false
  gesture2-divert: {1: false, 2: false, 10: false, 44: false, 64: false, 65: false, 67: false, 84: false, 85: false, 100: false}
  gesture2-gestures: {1: true, 2: true, 10: true, 30: true, 34: false, 42: true, 43: true, 45: false, 64: false, 65: false, 67: false, 84: true}
  gesture2-params:
    4: {scale: 256}

On K830, K400 wireless keyboards _battery field is 4096. After commit 11e7cbd, config.yaml doesn't appear to load, 'Swap Fx' (fn-swap) defaults to 'true' even though the setting is 'false'.

Selectively built on Manjaro Linux using makepkg/pkgbuild with specific commit.

@noabody noabody added the bug label Dec 4, 2024
@pfps
Copy link
Collaborator

pfps commented Dec 4, 2024

The workaround may be to remove the _battery line.

@MattHag
Copy link
Collaborator

MattHag commented Dec 5, 2024

Interesting thx, will take a look at the _battery entry.

MattHag added a commit to MattHag/Solaar that referenced this issue Dec 15, 2024
Enum is represented as special string, use enum value for config file

Fixes pwr-Solaar#2700
Related pwr-Solaar#2273
@MattHag
Copy link
Collaborator

MattHag commented Dec 15, 2024

@noabody Does this pull request fix the issue?

MattHag added a commit to MattHag/Solaar that referenced this issue Dec 15, 2024
Enforce use of enum value.

Fixes pwr-Solaar#2700
Related pwr-Solaar#2273
@noabody
Copy link
Author

noabody commented Dec 21, 2024

Still can't load config:

2024-12-21 08:03:46,424,424    ERROR [SolaarListener:hidraw3] solaar.configuration: failed to load from /home/desktop/.config/solaar/config.yaml: could not determine a constructor for the tag 'tag:yaml.org,2002:python/object/apply:logitech_receiver.hidpp20_constants.SupportedFeature'
  in "/home/desktop/.config/solaar/config.yaml", line 8, column 13
2024-12-21 08:03:49,817,817    ERROR [SolaarListener:hidraw2] logitech_receiver.base: (21) device 1 error on feature request {0B22}: 2 = 2
2024-12-21 08:03:49,817,817  WARNING [SolaarListener:hidraw2] logitech_receiver.settings: report_rate: error applying 1ms so ignore it (<Device(1,409F,G502 X LIGHTSPEED,redacted)>): FeatureCallError({'number': 1, 'request': 2850, 'error': 2, 'params': b'\x01'})
- 1.1.13-128-gb6f5f86c
- _NAME: Illuminated Living-Room Keyboard K830
  _absent: [hi-res-scroll, lowres-scroll-mode, hires-smooth-invert, hires-smooth-resolution, hires-scroll-mode, scroll-ratchet, smart-shift, thumb-scroll-invert,
    thumb-scroll-mode, onboard_profiles, report_rate, report_rate_extended, pointer_speed, dpi, dpi_extended, speed-change, backlight, backlight_level,
    backlight_duration_hands_out, backlight_duration_hands_in, backlight_duration_powered, backlight-timed, led_control, led_zone_, rgb_control, rgb_zone_,
    brightness_control, per-key-lighting, reprogrammable-keys, persistent-remappable-keys, crown-smooth, divert-crown, divert-gkeys, m-key-leds, mr-key-led,
    multiplatform, change-host, sidetone, equalizer, adc_power_management]
  _battery: !!python/object/apply:logitech_receiver.hidpp20_constants.SupportedFeature [4096]
  _modelId: B335404C0000
  _serial: redacted
  _unitId: redacted
  _wpid: 404C
  disable-keyboard-keys: {1: false, 4: false, 8: false, 16: false}
  divert-keys: {1: 0, 2: 0, 3: 0, 4: 0, 5: 0, 6: 0, 8: 0, 34: 0, 40: 0, 62: 0, 64: 0, 79: 0, 84: 0, 110: 0, 145: 0, 183: 0, 184: 0}
  fn-swap: true
  gesture2-divert: {1: false, 2: false, 10: false, 44: false, 64: false, 65: false, 67: false, 84: false, 85: false, 100: false}
  gesture2-gestures: {1: true, 2: true, 10: true, 30: true, 34: false, 42: true, 43: true, 45: false, 64: false, 65: false, 67: false, 84: true}
  gesture2-params:
    4: {scale: 256}
- _NAME: G613 Wireless Mechanical Gaming Keyboard
  _absent: [hi-res-scroll, lowres-scroll-mode, hires-smooth-invert, hires-smooth-resolution, hires-scroll-mode, scroll-ratchet, smart-shift, thumb-scroll-invert,
    thumb-scroll-mode, onboard_profiles, report_rate_extended, pointer_speed, dpi, dpi_extended, speed-change, backlight, backlight_level, backlight_duration_hands_out,
    backlight_duration_hands_in, backlight_duration_powered, backlight-timed, led_control, led_zone_, rgb_control, rgb_zone_, brightness_control, per-key-lighting,
    fn-swap, reprogrammable-keys, persistent-remappable-keys, disable-keyboard-keys, crown-smooth, divert-crown, m-key-leds, mr-key-led, multiplatform,
    gesture2-gestures, gesture2-divert, gesture2-params, sidetone, equalizer, adc_power_management]
  _battery: !!python/object/apply:logitech_receiver.hidpp20_constants.SupportedFeature [4096]
  _modelId: B34F40650000
  _serial: redacted
  _unitId: redacted
  _wpid: '4065'
  change-host: null
  divert-gkeys: false
  divert-keys: {209: 0, 210: 0}
  report_rate: 1
- _NAME: G502 X LIGHTSPEED
  _absent: [hi-res-scroll, lowres-scroll-mode, scroll-ratchet, smart-shift, thumb-scroll-invert, thumb-scroll-mode, report_rate_extended, pointer_speed,
    dpi_extended, speed-change, backlight, backlight_level, backlight_duration_hands_out, backlight_duration_hands_in, backlight_duration_powered, backlight-timed,
    led_control, led_zone_, rgb_control, rgb_zone_, brightness_control, per-key-lighting, fn-swap, reprogrammable-keys, persistent-remappable-keys, divert-keys,
    disable-keyboard-keys, crown-smooth, divert-crown, divert-gkeys, m-key-leds, mr-key-led, multiplatform, change-host, gesture2-gestures, gesture2-divert,
    gesture2-params, sidetone, equalizer, adc_power_management]
  _battery: !!python/object/apply:logitech_receiver.hidpp20_constants.SupportedFeature [4100]
  _modelId: 409FC0980000
  _serial: redacted
  _unitId: redacted
  _wpid: 409F
  dpi: 1600
  hires-scroll-mode: false
  hires-smooth-invert: false
  hires-smooth-resolution: false
  onboard_profiles: 1
  report_rate: 1

@MattHag
Copy link
Collaborator

MattHag commented Dec 21, 2024

Did you remove the battery entry before the start? It is malformed and won't load as is.

But it should create valid entries again.

@noabody
Copy link
Author

noabody commented Dec 21, 2024

Yep.

When changing versions it is necessary to exit solaar, delete ~/.config/solaar/config.yaml, install the test version, restart with -d parameter for debug info, exit to ensure config is saved, and restart.

@pfps pfps closed this as completed in 73c8821 Dec 23, 2024
@noabody
Copy link
Author

noabody commented Dec 23, 2024

Looks good:

- 1.1.14rc3
- _NAME: Illuminated Living-Room Keyboard K830
  _absent: [hi-res-scroll, lowres-scroll-mode, hires-smooth-invert, hires-smooth-resolution, hires-scroll-mode, scroll-ratchet, smart-shift, thumb-scroll-invert,
    thumb-scroll-mode, onboard_profiles, report_rate, report_rate_extended, pointer_speed, dpi, dpi_extended, speed-change, backlight, backlight_level,
    backlight_duration_hands_out, backlight_duration_hands_in, backlight_duration_powered, backlight-timed, led_control, led_zone_, rgb_control, rgb_zone_,
    brightness_control, per-key-lighting, reprogrammable-keys, persistent-remappable-keys, crown-smooth, divert-crown, divert-gkeys, m-key-leds, mr-key-led,
    multiplatform, change-host, sidetone, equalizer, adc_power_management]
  _battery: 4096
  _modelId: B335404C0000
  _serial: redacted
  _unitId: 424CF2B3
  _wpid: 404C
  disable-keyboard-keys: {1: false, 4: false, 8: false, 16: false}
  divert-keys: {1: 0, 2: 0, 3: 0, 4: 0, 5: 0, 6: 0, 8: 0, 34: 0, 40: 0, 62: 0, 64: 0, 79: 0, 84: 0, 110: 0, 145: 0, 183: 0, 184: 0}
  fn-swap: false
  gesture2-divert: {1: false, 2: false, 10: false, 44: false, 64: false, 65: false, 67: false, 84: false, 85: false, 100: false}
  gesture2-gestures: {1: true, 2: true, 10: true, 30: true, 34: false, 42: true, 43: true, 45: false, 64: false, 65: false, 67: false, 84: true}
  gesture2-params:
    4: {scale: 256}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants