Skip to content

Poll when the stream signals a session boundary - #434

Merged
sveinse merged 2 commits into
custom-components:masterfrom
rhammen:fix/issue-432-poll-on-session-start
Oct 6, 2026
Merged

sveinse merged 2 commits into
custom-components:masterfrom
rhammen:fix/issue-432-poll-on-session-start

Conversation

@rhammen

@rhammen rhammen commented Sep 14, 2026

Copy link
Copy Markdown
Contributor

ChargerCurrentUserUuid (722) and CompletedSession (723) are never pushed
over the live stream, so they only change on a poll — 10 minutes apart while
the charger is idle. A short authorized session can fall between two polls and
never show up at all. The sensors from #431 read 722 directly.

ChargerOperationMode (710) and SessionIdentifier (721) do stream, and
change on the same session boundaries. stream_callback now runs the existing
coordinator poll sequence ([2, 7, 15] s) when either arrives. trigger_poll
cancels an in-flight sequence, so a burst of frames collapses into one.

Any 710 value triggers, not only Disconnected: a plug-in is where authorization
becomes relevant, and the extra polls on charging transitions are a handful per
session against the 60 s charging interval.

Verified on a Go 2 (fw 3.3.0.0), unplug then plug back in:

+0.0 s   710 → Disconnected          streamed
+2.1 s   722 cleared                 poll 1
+7.1 s   CompletedSession updated    poll 2  (not yet available at +2 s)

An app authorization later in the same session was visible on 722 about 2 s
after its 721 frame. Without this, both wait for the next 10-minute poll; a 25 s
session on 2026-09-09 was missed entirely.

Clearing 722 at session end still relies on #425 — this only makes it appear
sooner.

#418 also adds tests/test_manager.py; the two files are disjoint, whoever
merges second concatenates.

Fixes #432

🤖 Generated with Claude Code

ChargerCurrentUserUuid and CompletedSession are never pushed over the live
stream, so they only change when the charger is polled -- 10 minutes apart
while idle. A short authorized session can pass between two polls and never
show up at all.

ChargerOperationMode (710) and SessionIdentifier (721) do stream, and change
on the same boundaries where those two are written. Trigger the existing
coordinator poll sequence when either arrives.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@sveinse

sveinse commented Oct 6, 2026

Copy link
Copy Markdown
Collaborator

Please resolve the conflicts in this PR. Thanks.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@sveinse
sveinse merged commit 302c54c into custom-components:master Oct 6, 2026
5 of 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.

Poll on session start: ChargerCurrentUserUuid is never pushed over the stream

2 participants