fix: PGXL status-bar chip and Station Control widget read OPERATE from the Flex when it reports the amp (the direct GSCP status doesn't carry operate state) — toggle then goes through FlexAmpOperate like the Flex panel; direct TCP link stays as fallback; log distinct raw PGXL status payloads to map unknown fields

This commit is contained in:
2026-07-22 09:33:39 +02:00
parent c91c8c3b47
commit 5aac28f564
3 changed files with 51 additions and 7 deletions
+9
View File
@@ -15,6 +15,8 @@ import (
"sync"
"sync/atomic"
"time"
"hamlog/internal/applog"
)
const (
@@ -46,6 +48,7 @@ type Client struct {
statusMu sync.RWMutex
status Status
lastRaw string // last raw status payload — logged on change so unknown fields (operate?) can be mapped from a real amp
// Optimistic fan mode kept until the amp's status poll confirms it (or it
// ages out) — otherwise a stale poll right after a change reverts the UI.
fanPending string
@@ -223,6 +226,12 @@ func (c *Client) parse(resp string) {
c.statusMu.Lock()
c.status.Connected = true
c.status.LastError = ""
// Log each DISTINCT status payload once: the PGXL's field set isn't fully
// documented, so this is how we learn the real key for e.g. operate/standby.
if data != c.lastRaw {
c.lastRaw = data
applog.Printf("pgxl: status raw=%q", data)
}
for _, pair := range strings.Fields(data) {
kv := strings.SplitN(pair, "=", 2)
if len(kv) != 2 {