Add get_electricity_price (EDF Tempo calendar / tariff) #37

Merged
mat merged 1 commit from feat/get-electricity-price into main 2026-07-05 08:23:10 +00:00
Owner

Summary

Adds a single read-only client method for the EDF Tempo calendar / tariff structure.

  • get_electricity_price(self, site_id) -> dictGET /electricityprice?siteId=.
  • Returns the Tempo structure: tempoSyntheses (per-colour day counts), daily (per-day colour + off-peak/peak windows), tempoSynthesesComplete.
  • Endpoint live-verified (200). Great basis for Tempo-aware Home Assistant automations.

Changes

  • comwatt_client/client.py: new get_electricity_price method (same pattern/style as get_tiles).
  • tests/test_electricity_price.py: success + 500-error tests (mirrors test_tiles.py, asserts the siteId query param).
  • README.md: one method-list entry.

Test plan

  • pytest — 83 passed (81 baseline + 2 new).
  • mypy comwatt_client — clean.
  • TDD: new tests fail before implementation, pass after.

Draft — mark ready when you want it reviewed.

## Summary Adds a single read-only client method for the EDF **Tempo** calendar / tariff structure. - `get_electricity_price(self, site_id) -> dict` → `GET /electricityprice?siteId=`. - Returns the Tempo structure: `tempoSyntheses` (per-colour day counts), `daily` (per-day colour + off-peak/peak windows), `tempoSynthesesComplete`. - Endpoint live-verified (200). Great basis for Tempo-aware Home Assistant automations. ## Changes - `comwatt_client/client.py`: new `get_electricity_price` method (same pattern/style as `get_tiles`). - `tests/test_electricity_price.py`: success + 500-error tests (mirrors `test_tiles.py`, asserts the `siteId` query param). - `README.md`: one method-list entry. ## Test plan - [x] `pytest` — 83 passed (81 baseline + 2 new). - [x] `mypy comwatt_client` — clean. - [x] TDD: new tests fail before implementation, pass after. Draft — mark ready when you want it reviewed.
Add get_electricity_price (EDF Tempo calendar / tariff)
Some checks are pending
Tests / forgejo-pytest (pull_request) Waiting to run
Tests / forgejo-pytest (push) Waiting to run
f8af8a7b44
New read-only method GET /electricityprice?siteId= returning the EDF Tempo
calendar / tariff structure (tempoSyntheses, daily, tempoSynthesesComplete).
Live-verified endpoint. Adds tests/test_electricity_price.py and a README entry.
mat changed title from WIP: Add get_electricity_price (EDF Tempo calendar / tariff) to Add get_electricity_price (EDF Tempo calendar / tariff) 2026-07-05 08:22:40 +00:00
mat force-pushed feat/get-electricity-price from f8af8a7b44
Some checks are pending
Tests / forgejo-pytest (pull_request) Waiting to run
Tests / forgejo-pytest (push) Waiting to run
to f0eddd83b5
All checks were successful
Tests / forgejo-pytest (push) Successful in 43s
Tests / forgejo-pytest (pull_request) Successful in 42s
2026-07-05 08:22:59 +00:00
Compare
mat merged commit 4c679df9ef into main 2026-07-05 08:23:10 +00:00
mat deleted branch feat/get-electricity-price 2026-07-05 08:23:10 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
mat/python-comwatt-client!37
No description provided.