Skip to content

feat(daily_savings): expose lifetime co2_saved_kg as attribute - #11

Merged
mrebbert merged 1 commit into
mainfrom
feature/co2-saved-attribute
Aug 10, 2026
Merged

feat(daily_savings): expose lifetime co2_saved_kg as attribute#11
mrebbert merged 1 commit into
mainfrom
feature/co2-saved-attribute

Conversation

@mrebbert

Copy link
Copy Markdown
Owner

Summary

  • Adds co2_saved_kg attribute on the daily_savings sensor.
  • Sourced from system.get_impact_overview() (lifetime CO2 avoided, kg) fetched once at setup.
  • Non-fatal on failure — attribute is absent when the endpoint returns None or errors.

Test plan

  • Unit + integration tests green (.venv/bin/pytest -q → 226 passed).
  • mypy + ruff clean.
  • Live-deployed on homie; sensor.heizungskeller_1k5_tagesersparnis now shows co2_saved_kg: 3206.15 on the attributes.

Setup-time fetch of `system.get_impact_overview()` populates a new
`co2_saved_kg` attribute on the daily-savings sensor. Non-fatal on
failure — attribute is absent when the endpoint returns None or errors.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@mrebbert
mrebbert merged commit ab360e0 into main Aug 10, 2026
8 checks passed
@mrebbert
mrebbert deleted the feature/co2-saved-attribute branch August 10, 2026 04:39
mrebbert pushed a commit that referenced this pull request Aug 12, 2026
Three PRs (#12/#13/#14) landed post-#11 with no user-visible change —
document them under `[Unreleased] > Changed` so the eventual release
captures them alongside the co2_saved_kg addition.

Per feedback-release-notes-scope memory: refactor mentions stay in
CHANGELOG only; release-notes/v0.1.53.md (when created at release
time) stays user-facing.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
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