✨ feat: get_product(product_id) #154

Merged
mat merged 1 commit from feat/get-product into main 2026-10-27 09:53:23 +00:00
Owner

Summary

 CataloguesMixin (_catalogues.py)
   get_products()                → GET /api/products
+  get_product(product_id)       → GET /api/products/{id}

Detail read for a single catalogue product, same shape as the list entries ({id, name, brand, cardinality, features} — live-verified 2026-10-11, see docs/energy.comwatt.com/misc-endpoints.md). Unknown-id behavior not probed live; noted in the docstring.

Evidence

  • Before: AttributeError: 'ComwattClient' object has no attribute 'get_product'; baseline pytest = 179 passed.
  • After: 3 new mocked tests (happy path, str-id accepted, 500→ComwattAPIError, asserting method/path/query); pytest = 182 passed; mypy clean.

Merge Danger

Door: two-way — purely additive; revert restores the previous client exactly.

Blast Radius: minimal — one new public method on CataloguesMixin, nothing existing touched.

Closes #152

## Summary ```diff CataloguesMixin (_catalogues.py) get_products() → GET /api/products + get_product(product_id) → GET /api/products/{id} ``` Detail read for a single catalogue product, same shape as the list entries (`{id, name, brand, cardinality, features}` — live-verified 2026-10-11, see `docs/energy.comwatt.com/misc-endpoints.md`). Unknown-id behavior not probed live; noted in the docstring. ## Evidence - **Before:** `AttributeError: 'ComwattClient' object has no attribute 'get_product'`; baseline `pytest` = 179 passed. - **After:** 3 new mocked tests (happy path, str-id accepted, 500→`ComwattAPIError`, asserting method/path/query); `pytest` = **182 passed**; `mypy` clean. ## Merge Danger **Door:** two-way — purely additive; revert restores the previous client exactly. **Blast Radius:** minimal — one new public method on `CataloguesMixin`, nothing existing touched. Closes #152
✨ feat: get_product(product_id) (#152)
All checks were successful
Tests / forgejo-pytest (push) Successful in 43s
Tests / forgejo-pytest (pull_request) Successful in 42s
6a62569cc7
mat changed title from WIP: ✨ feat: get_product(product_id) to ✨ feat: get_product(product_id) 2026-10-27 09:53:19 +00:00
mat merged commit 9c418f02c9 into main 2026-10-27 09:53:23 +00:00
mat deleted branch feat/get-product 2026-10-27 09:53:23 +00:00
mat referenced this pull request from a commit 2026-10-27 09:53:25 +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!154
No description provided.