Skip to content

fix(energy): align energy_totals with PR 321's trimmed SSE payload - #17

Merged
Bre77 merged 1 commit into
mainfrom
fm/pts-energy-totals-trim-align
Jul 29, 2026
Merged

fix(energy): align energy_totals with PR 321's trimmed SSE payload#17
Bre77 merged 1 commit into
mainfrom
fm/pts-energy-totals-trim-align

Conversation

@Bre77

@Bre77 Bre77 commented Jul 29, 2026

Copy link
Copy Markdown
Member

Intent

  • Align energy_totals with Teslemetry/api PR 321, which trimmed the SSE event payload.
    • Server now sends only id, createdAt, and totals on the event, plus isCache only when true - product_type, topic, and url were dropped as redundant with the event's own topic name and site id.
    • listen_EnergyTotals filters on id/totals instead of id/product_type/topic; Key.PRODUCT_TYPE/Key.TOPIC/Key.URL stay in const.py for other event kinds, just unused by this path now.
    • Docstring and tests/test_energysite_events.py fixtures updated to the trimmed shape.
  • Adoption of energy_totals is effectively zero since feat(energy): add typed energy_totals listener for calendar_history refreshes #15 landed, so no deprecation path needed.

product_type/topic/url are dropped from the wire event and isCache is
now optional-true only, matching the convention already used by
live_status/site_info/tariff_content_v2.
@Bre77
Bre77 merged commit 56d8b71 into main Jul 29, 2026
15 checks passed

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: bf1bd1673e

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +83 to +84
never staleness; there is no snapshot-on-connect delivery. This
listener only exposes the totals.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Remove the obsolete URL instructions from the README

When users consult the public API documentation, README.md lines 170-173 and 312-313 still say that energy_totals carries a url that they should GET. The trimmed event no longer contains that field, and this listener exposes only the totals, so those instructions cannot be followed; update both README passages to omit the URL or name the REST endpoint directly.

AGENTS.md reference: AGENTS.md:L13-L13

Useful? React with 👍 / 👎.

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