Skip to content

fix: request the feature-flag tokens in getReadings - #52

Merged
Xerolux merged 1 commit into
mainfrom
fix/getreadings-feature-flag-tokens
Oct 2, 2026
Merged

Xerolux merged 1 commit into
mainfrom
fix/getreadings-feature-flag-tokens

Conversation

@Xerolux

@Xerolux Xerolux commented Oct 2, 2026

Copy link
Copy Markdown
Owner

Problem

Reported on poolsteuerung.de (thread p=39074): after a controller restart/timeout, the daily Chlor/pH-Minus dosing sensors in the Home Assistant integration turn unknown. The cause is in this library: get_readings() queries plain getReadings?ALL, and the controller's getReadings.js gates the computed field groups behind feature-flag tokens — plain ALL does not include them:

  • DOSAGE → DOS_*_DAILY_DOSING_AMOUNT_ML, DOS_*_TOTAL_CAN_AMOUNT_ML, DOS_*_REMAINING_RANGE, …
  • RUNTIMES → *_RUNTIME strings
  • PUMPPRIOSTATE → composite PUMPSTATE/HEATERSTATE/SOLARSTATE
  • BACKWASH → backwash counters
  • SYSTEM → SYSTEM_* diagnostics

(the token semantics are already documented above SPECIFIC_READING_GROUPS in const_api.py).

Fix

get_readings() and get_hardware_profile() now send ${QUERY_FULL_REFRESH} = ALL,DOSAGE,RUNTIMES,PUMPPRIOSTATE,BACKWASH,SYSTEM, restoring the documented "complete dataset" semantics.

Verification

  • Live controller (firmware 1.2.5): the mixed query returns exactly the same 419-key payload as plain ALL — 0 keys lost, 0 added, only MEMORY_USED (a live counter) differs in value. The fix is a no-op where plain ALL already works and restores the missing groups where it does not.
  • Full test suite: 261 passed.
  • ruff check clean.

Tests

  • 18 existing URL mocks updated to the full query.
  • New test_get_readings_requests_all_feature_flags pins the query string.
  • Mock server: ALL + tokens now returns the unfiltered payload (matches firmware), covered by a new raw-HTTP test.

Plain `ALL` stopped returning the computed field groups on every firmware
state: after a controller restart/timeout the daily dosing totals
(DOS_*_DAILY_DOSING_AMOUNT_ML and friends), runtime strings, priority-state
composites, backwash counters and SYSTEM_* diagnostics are gated behind the
DOSAGE/RUNTIMES/PUMPPRIOSTATE/BACKWASH/SYSTEM tokens and simply missing from
the response, leaving the matching Home Assistant sensors at 'unknown'
(reported on poolsteuerung.de; getReadings.js documents the tokens as feature
flags, not regex filters).

get_readings() and get_hardware_profile() now send
ALL,DOSAGE,RUNTIMES,PUMPPRIOSTATE,BACKWASH,SYSTEM (QUERY_FULL_REFRESH).
Verified against a live controller on firmware 1.2.5: identical 419-key
payload to plain ALL, so nothing changes where ALL already worked. The mock
server treats ALL plus tokens as no filtering, like the firmware.
@Xerolux
Xerolux merged commit b9a7b50 into main Oct 2, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant