Repository navigation
fix: request the feature-flag tokens in getReadings - #52
Merged
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 plaingetReadings?ALL, and the controller'sgetReadings.jsgates the computed field groups behind feature-flag tokens — plainALLdoes not include them:DOSAGE→DOS_*_DAILY_DOSING_AMOUNT_ML,DOS_*_TOTAL_CAN_AMOUNT_ML,DOS_*_REMAINING_RANGE, …RUNTIMES→*_RUNTIMEstringsPUMPPRIOSTATE→ compositePUMPSTATE/HEATERSTATE/SOLARSTATEBACKWASH→ backwash countersSYSTEM→SYSTEM_*diagnostics(the token semantics are already documented above
SPECIFIC_READING_GROUPSinconst_api.py).Fix
get_readings()andget_hardware_profile()now send${QUERY_FULL_REFRESH}=ALL,DOSAGE,RUNTIMES,PUMPPRIOSTATE,BACKWASH,SYSTEM, restoring the documented "complete dataset" semantics.Verification
ALL— 0 keys lost, 0 added, onlyMEMORY_USED(a live counter) differs in value. The fix is a no-op where plainALLalready works and restores the missing groups where it does not.ruff checkclean.Tests
test_get_readings_requests_all_feature_flagspins the query string.ALL+ tokens now returns the unfiltered payload (matches firmware), covered by a new raw-HTTP test.