Repository navigation
Bound GALEVO recovery and share HTTP 429 cooldowns - #199
waterfietser wants to merge 7 commits into
Conversation
| (item.get("id"), item.get(PropertyType.ZONE)) | ||
| for item in self.data.get("items", []) | ||
| } | ||
| if not keys or not previous_keys.issubset(keys): |
There was a problem hiding this comment.
Scope snapshot completeness to the current zone configuration. After a heating zone is removed and async_get_features() returns the new zone list, subsequent complete property responses still fail this guard because the previous snapshot contains keys for the removed zone. Compare only keys that still apply to the current configuration.
There was a problem hiding this comment.
Fixed in 0c93c36. The completeness guard compares previously reported keys for the currently configured zones, including device-wide zone 0. The regression test refreshes the features after removing zone 2 and verifies that the new snapshot is accepted.
There was a problem hiding this comment.
Apply the optional ChFlowTemp rule to snapshot validation. If the previous snapshot included ChFlowTemp, this guard still requires it on the next poll. I reproduced a heat-pump refresh where split recovery returned all 43 required properties and fresh menu item 349 supplied the flow temperature, yet the device rejected the snapshot. Use the same optional-property rule in both recovery and snapshot validation, and add a test where ChFlowTemp is present on one poll and absent on the next.
| (item.get("id"), item.get(PropertyType.ZONE)) | ||
| for item in self.data.get("items", []) | ||
| } | ||
| if not keys or not previous_keys.issubset(keys): |
There was a problem hiding this comment.
Apply the optional ChFlowTemp rule to snapshot validation. If the previous snapshot included ChFlowTemp, this guard still requires it on the next poll. I reproduced a heat-pump refresh where split recovery returned all 43 required properties and fresh menu item 349 supplied the flow temperature, yet the device rejected the snapshot. Use the same optional-property rule in both recovery and snapshot validation, and add a test where ChFlowTemp is present on one poll and absent on the next.
| self.custom_features.clear() | ||
| self.custom_features.update(previous_features) | ||
| raise | ||
| self.menu_items_fresh = menu_items is not None |
There was a problem hiding this comment.
Mark partial menu refreshes as stale. If a menu group request and an individual item retry both return HTTP 500, the API skips the failed item and returns the rest. I reproduced a previously available heat-pump outdoor temperature disappearing and its capability flag turning off while menu_items_fresh stayed True. Preserve the last value for previously seen items whose fetch failed, and mark the menu refresh stale.
|
|
||
| def _update_state(self) -> None: | ||
| """Set custom features""" | ||
| if self.custom_features.get(CustomDeviceFeatures.HAS_OUTSIDE_TEMP) is None: |
There was a problem hiding this comment.
A partial first response that omits OutsideTemp sets HAS_OUTSIDE_TEMP to False for the session. A later response with a valid reading leaves the flag disabled. Leave the capability undecided when the row is missing so a later complete response can establish it. This is a pre existing issue, if you could fix it will be nice
Background
When a GALEVO property batch fails with HTTP 500 or times out, recovery can fan out into pair requests, individual requests, and provider-cache lookups. During a cloud outage, this can turn one failed poll into dozens of additional requests. The existing HTTP 429 handler also retries after waiting, and its cooldown applies only to the API instance that received the response.
Changes
Retry-Afterand the server’s reported block duration. When neither is usable, start at 60 seconds and double the fallback up to 15 minutes.Verification
All 98 library tests passed on Linux with Python 3.14.2. The Home Assistant integration suite also passed all 82 tests against the patched checkout. The tests cover request and time budgets, concurrent rate limits, multi-zone recovery, and state retention. Live validation on an ATAG ONE thermostat is still pending.
Reported in waterfietser/ariston-remotethermo-home-assistant-v3#1.