From f1c8f22fbcaebec1291228e022c3bf1da418307c Mon Sep 17 00:00:00 2001 From: Ken Sanislo Date: Sat, 18 Apr 2026 12:46:49 -0700 Subject: [PATCH] Log GetHostModeState before/after write for RGB diagnostic MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit solaar show has been reporting headset-rgb-hostmode as False even when SetHostModeState(1) just succeeded without error. Could be: (a) the write doesn't actually stick on the device, OR (b) our GetHostModeState response decode is wrong, OR (c) the device uses a different function for "read" than we expect. Log the raw response bytes returned by function 7 (GetHostModeState) immediately before and after the SetHostModeState write so the next test log will show: - what byte the device returns for "off" - what byte the device returns for "on" - whether the byte changes across a write Diagnostic only — temporary; remove once we've isolated the cause. --- lib/logitech_receiver/settings_templates.py | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/lib/logitech_receiver/settings_templates.py b/lib/logitech_receiver/settings_templates.py index 954a1a22..d02544f3 100644 --- a/lib/logitech_receiver/settings_templates.py +++ b/lib/logitech_receiver/settings_templates.py @@ -1931,6 +1931,25 @@ class HeadsetRGBHostMode(settings.Setting): rw_options = {"read_fnid": 0x70, "write_fnid": 0x80} validator_class = settings_validator.BooleanValidator + def write(self, value, save=True): + # Diagnostic wrapper: log what GetHostModeState returns immediately + # before AND after the SetHostModeState write, so we can see whether + # (a) the write takes effect on the device or (b) our decoding of the + # response is wrong. solaar show has been reporting this value as + # False even after writes we believed succeeded. + try: + before = self._device.feature_request(self.feature, 0x70) + except Exception as e: + before = f"" + logger.info("HeadsetRGBHostMode.write: before=%s requested=%s", before, value) + result = super().write(value, save=save) + try: + after = self._device.feature_request(self.feature, 0x70) + except Exception as e: + after = f"" + logger.info("HeadsetRGBHostMode.write: after=%s write_returned=%s", after, result) + return result + class HeadsetRGBColor(settings.Setting): """Pick a color from the shared `special_keys.COLORS` palette and apply it