From d7a279fd78b0a71dbf921f2cca1034ff8a976bc1 Mon Sep 17 00:00:00 2001 From: Ken Sanislo Date: Fri, 24 Apr 2026 20:49:31 -0700 Subject: [PATCH] Fix HeadsetAdvancedEQ.validate_read after parse_v2_bands signature change parse_v2_bands now takes the full getEQInfos dict (needs gain_min, gain_max, and gain_steps for the offset-binary gain decode) instead of just step_db. The validator was still passing step_db, which would hit AttributeError on .get when refreshing the EQ panel value. Cache the four gain bounds on the validator at build time and reconstruct the info dict at validate_read time. --- lib/logitech_receiver/settings_templates.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/lib/logitech_receiver/settings_templates.py b/lib/logitech_receiver/settings_templates.py index 665ea241..09b39e46 100644 --- a/lib/logitech_receiver/settings_templates.py +++ b/lib/logitech_receiver/settings_templates.py @@ -1925,6 +1925,9 @@ class HeadsetAdvancedEQ(settings.RangeFieldSetting): ) v._version = version v._step_db = step_db + v._gain_min = gain_min + v._gain_max = gain_max + v._gain_steps = info.get("gain_steps", 241) v._band_types = [band[0] for band in bands] v._band_freqs = [band[1] for band in bands] v._active_slot = active_slot @@ -1951,9 +1954,14 @@ class HeadsetAdvancedEQ(settings.RangeFieldSetting): if reply_bytes is None: return {} version = getattr(self, "_version", 0) - step_db = getattr(self, "_step_db", 1.0) if version >= 2: - bands = hidpp20.parse_v2_bands(reply_bytes, step_db) + info = { + "gain_min_db": getattr(self, "_gain_min", -6), + "gain_max_db": getattr(self, "_gain_max", 6), + "gain_steps": getattr(self, "_gain_steps", 241), + "step_db": getattr(self, "_step_db", 0.05), + } + bands = hidpp20.parse_v2_bands(reply_bytes, info) if bands is None: return {} result = {}