📝 fix: aggregationLevel rejects WEEK — document real enum set #57

Merged
mat merged 1 commit from fix-aggregationlevel-docs into main 2026-09-06 16:38:21 +00:00
Owner

What

Live-verified against https://energy.comwatt.com on all five /aggregations/* endpoints (site-networks-ts-time-ago, time-series, site-time-series, top-consumption, consumption-breakdown-time-ago):

  • aggregationLevel accepts NONE, HOUR, DAY, MONTH, YEAR; WEEK → 400 Failed to convert 'aggregationLevel' with value: 'WEEK'
  • timeAgoUnit differs: HOUR, DAY, WEEK, MONTH, YEAR (WEEK valid, NONE rejected)

Changes

  • docs/energy.comwatt.com/aggregations.md: fix the aggregationLevel enum row (drop WEEK, reword the SPA scale mapping — the SPA never sends aggregationLevel=WEEK) and spell out the timeAgoUnit set instead of the now-false "same as aggregationLevel"
  • comwatt_client/_aggregations.py: document both enums in the docstrings of all five methods taking aggregation_level/time_ago_unit
  • tests/test_aggregations.py: replace the WEEK example value with MONTH (mocked query-string test)
  • ROADMAP.md: tick the field-notes item

Closes ROADMAP item §1 "aggregationLevel does not accept WEEK".

Verification

  • Live probe: 5 endpoints × 6 values + timeAgoUnit probe (results in the table above)
  • pytest: 132 passed; only pre-existing environmental failure test_version_matches_installed_metadata (identical on main, editable-install metadata)
## What Live-verified against https://energy.comwatt.com on **all five** `/aggregations/*` endpoints (site-networks-ts-time-ago, time-series, site-time-series, top-consumption, consumption-breakdown-time-ago): - `aggregationLevel` accepts `NONE`, `HOUR`, `DAY`, `MONTH`, `YEAR`; `WEEK` → `400 Failed to convert 'aggregationLevel' with value: 'WEEK'` - `timeAgoUnit` differs: `HOUR`, `DAY`, `WEEK`, `MONTH`, `YEAR` (`WEEK` valid, `NONE` rejected) ## Changes - `docs/energy.comwatt.com/aggregations.md`: fix the `aggregationLevel` enum row (drop `WEEK`, reword the SPA `scale` mapping — the SPA never sends `aggregationLevel=WEEK`) and spell out the `timeAgoUnit` set instead of the now-false "same as `aggregationLevel`" - `comwatt_client/_aggregations.py`: document both enums in the docstrings of all five methods taking `aggregation_level`/`time_ago_unit` - `tests/test_aggregations.py`: replace the `WEEK` example value with `MONTH` (mocked query-string test) - `ROADMAP.md`: tick the field-notes item Closes ROADMAP item §1 "aggregationLevel does not accept WEEK". ## Verification - Live probe: 5 endpoints × 6 values + `timeAgoUnit` probe (results in the table above) - `pytest`: 132 passed; only pre-existing environmental failure `test_version_matches_installed_metadata` (identical on `main`, editable-install metadata)
📝 fix: aggregationLevel rejects WEEK — document real enum set
All checks were successful
Tests / forgejo-pytest (push) Successful in 44s
Tests / forgejo-pytest (pull_request) Successful in 42s
64273fe824
Live-verified on all five /aggregations/* endpoints: aggregationLevel
accepts NONE, HOUR, DAY, MONTH, YEAR and rejects WEEK with a 400.
timeAgoUnit differs: WEEK is valid there, NONE is not.

- aggregations.md: fix aggregationLevel enum row (drop WEEK, reword the
  SPA scale mapping) and spell out the timeAgoUnit set instead of
  'same as aggregationLevel'
- _aggregations.py: document both enums in all five docstrings
- test_aggregations.py: stop using WEEK as an example value
- ROADMAP.md: tick the item
mat changed title from WIP: 📝 fix: aggregationLevel rejects WEEK — document real enum set to 📝 fix: aggregationLevel rejects WEEK — document real enum set 2026-09-06 16:38:13 +00:00
mat merged commit 2de128485b into main 2026-09-06 16:38:21 +00:00
mat deleted branch fix-aggregationlevel-docs 2026-09-06 16:38:21 +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!57
No description provided.