Solaar/tests/logitech_receiver
Ken Sanislo 35aad431d1 receiver: close paired devices before dropping the handle
Receiver.close() nulled its own handle first and only then closed its
paired devices. A paired device's feature_request() sends over the
receiver's handle, so the device.cleanups callbacks that run inside
Device.close() - release RGB SW control, restore onboard-profile mode -
were issued with handle=None, failed, and were silently swallowed. On
every clean Solaar quit a receiver-paired keyboard was left in host
mode; on the G915 TKL that means dead F-keys until a power cycle
(#3266). Wired devices were unaffected: Device.close() already runs
cleanups before clearing its handle, per its own comment.

Close the devices first, then drop the handle, mirroring Device.close().
Also log cleanup write failures in rgb_power.cleanup at debug level
instead of swallowing them silently, so a torn-down transport can't
hide; debug because failures are routine when the device is unplugged.

The regression test fails against the previous ordering.
2026-07-31 16:30:39 -04:00
..
__init__.py tests: Add tests of common module 2024-02-18 06:10:53 -05:00
fake_hidpp.py centurion: Headset icon kind at construction (#3226) 2026-05-19 15:36:29 -04:00
test_base.py G522 LIGHTSPEED headphones support 2026-05-21 10:13:00 -04:00
test_base_usb.py Speedup lookup of known receivers 2025-01-01 11:33:07 -05:00
test_common.py ui: Show offline status for receiver-paired device batteries (#3217) 2026-05-13 17:32:03 -04:00
test_desktop_notifications.py tests: mock the libnotify backend so the suite raises no real notifications 2026-05-21 10:15:12 -04:00
test_device.py G522 LIGHTSPEED headphones support 2026-05-21 10:13:00 -04:00
test_diversion.py Refactor: Introduce Feature enum 2024-10-14 07:28:09 -04:00
test_hidpp10.py device: Handle composite IntFlag.name on Python < 3.11 (#3187) 2026-04-16 11:38:25 -04:00
test_hidpp20_complex.py G522 LIGHTSPEED headphones support 2026-05-21 10:13:00 -04:00
test_hidpp20_simple.py device: Fix operator precedence bug and end-of-configuration timing in device.changed() (#3173) 2026-05-13 11:30:26 -04:00
test_notifications.py show better pairing errors (#3063) 2025-12-10 11:18:50 -05:00
test_receiver.py receiver: close paired devices before dropping the handle 2026-07-31 16:30:39 -04:00
test_rgb_power.py rgb_control: honor the off state — don't auto-claim, init, or shutdown LEDs 2026-05-15 10:45:27 -04:00
test_setting_templates.py headset RGB: regression tests for _HeadsetOnboardEffect color seeding 2026-05-21 10:13:00 -04:00
test_settings_validator.py common: render RGB color values as 0xrrggbb in config and solaar show 2026-05-12 12:51:36 -04:00