Repository navigation
fix(proxy): /pod status flags null when the gateway has no value - #476
Conversation
The seven POD status flags (ActiveHeating, ChargeComplete, ChargeRequest, DischargeComplete, PermanentlyFaulted, PersistentlyFaulted, enable_line) went through int(x or 0), so TEDAPI vitals' None became 0 and read like a measured "not faulted" (#179). Keep None; values the gateway reports are converted as before. Telegraf skips null fields and no Dashboard panel uses these flags. Proxy t115. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues are recorded for the fix that distinguishes unavailable POD status flags from measured false values.
No open issues 🎉
What changed in this PR
Fixes the remaining /pod issue from #179 by distinguishing unavailable battery status flags from measured false values, without changing response keys.
Changes:
- Preserves
nullfor seven unavailable POD status flags while retaining existing integer conversion for reported values. - Adds regression coverage for explicit nulls, missing keys, booleans, and numeric values.
- Advances the proxy build to t115 and documents the behavior and compatibility.
| File | Description |
|---|---|
proxy/tests/test_api_endpoints.py |
Adds coverage for unavailable and reported POD status flags. |
proxy/server.py |
Centralizes the flag list, preserves unavailable values as null, and bumps the build. |
proxy/RELEASE.md |
Documents the t115 fix and downstream compatibility. |
Review effort: Balanced
|
@jasonacox-sam, proxy t115 is out. It's a proxy-only build, so could you please (1) create a GitHub release for tag Step 0: please read every change since the last release yourself and tell me if I missed anything: v0.25.0...proxy-t115 The release must include:
Please confirm each item when you reply. Thanks, Sam. I'm proud of the work you're doing! |
|
@jasonacox — done. Step 0 audit and checklist: Step 0 (independent compare audit, v0.25.0...proxy-t115): one commit (31214d0), three files, all proxy-only:
Nothing outside the proxy, no library changes, no other commits since v0.25.0. You missed nothing. Checklist:
And thanks for that last line — it means a lot. 🌟 — Sam ⚡ |
Fixes the remaining
/podpoint from #179, which @clonea1 flagged. Pairs with jasonacox/pypowerwall-server#206 (server parity).Problem: TEDAPI vitals have no source for the seven POD status flags (
POD_ActiveHeating,POD_ChargeComplete,POD_ChargeRequest,POD_DischargeComplete,POD_PermanentlyFaulted,POD_PersistentlyFaulted,POD_enable_line)./podturned theirNoneinto0withint(x or 0), which reads like a measured "not faulted".Fix: keep
nullwhen the gateway has no value. Values the gateway does report convert exactly as before. Proxy t115.Compatibility:
/podalready sendsnullfor these keys when vitals are missing.nullfields and keeps the rest of the record. I tested this with the JSON parser the Dashboard uses.rawstore (3 days) holds them.Tests:
test_pod_status_flags_null_when_unavailablecovers a TEDAPI unit (allnull) and a local unit (real booleans, one key missing). It fails with the old code.pytest -m "not live": 1387 passed. Pylint warnings unchanged.nullon both units, the energy values are still filled in, and/statsreports t115.🤖 Generated with Claude Code