✨ feat: get_connected_object_devices(connected_object_id) #155

Merged
mat merged 1 commit from feat/get-connected-object-devices into main 2026-10-27 09:56:14 +00:00
Owner

Summary

 ConnectedObjectsMixin (_connected_objects.py)
   get_connected_objects(site_id=…, gateway_uid=…)
   get_connected_object(connected_object_id)
+  get_connected_object_devices(connected_object_id)  → GET /api/connectedobjects/{id}/devices

Devices of one connected object — narrower than get_devices(site_id) (only the entries whose parent CO is this one). Endpoint returned 200 live; exact payload shape wasn't captured in the field notes, so entries pass through as-is (noted in the docstring). See docs/energy.comwatt.com/devices.md → Connected objects.

Evidence

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

Merge Danger

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

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

Closes #98

## Summary ```diff ConnectedObjectsMixin (_connected_objects.py) get_connected_objects(site_id=…, gateway_uid=…) get_connected_object(connected_object_id) + get_connected_object_devices(connected_object_id) → GET /api/connectedobjects/{id}/devices ``` Devices of one connected object — narrower than `get_devices(site_id)` (only the entries whose parent CO is this one). Endpoint returned 200 live; exact payload shape wasn't captured in the field notes, so entries pass through as-is (noted in the docstring). See `docs/energy.comwatt.com/devices.md` → *Connected objects*. ## Evidence - **Before:** `AttributeError: 'ComwattClient' object has no attribute 'get_connected_object_devices'`; baseline `pytest` = 182 passed. - **After:** 3 new mocked tests (happy path, str-id accepted, 500→`ComwattAPIError`, asserting method/path/query); `pytest` = **185 passed**; `mypy` clean. ## Merge Danger **Door:** two-way — purely additive; revert restores the previous client exactly. **Blast Radius:** minimal — one new public method on `ConnectedObjectsMixin`, nothing existing touched. Closes #98
✨ feat: get_connected_object_devices(connected_object_id) (#98)
All checks were successful
Tests / forgejo-pytest (pull_request) Successful in 43s
Tests / forgejo-pytest (push) Successful in 43s
0173282927
mat changed title from WIP: ✨ feat: get_connected_object_devices(connected_object_id) to ✨ feat: get_connected_object_devices(connected_object_id) 2026-10-27 09:56:07 +00:00
mat merged commit e53b3cf529 into main 2026-10-27 09:56:14 +00:00
mat deleted branch feat/get-connected-object-devices 2026-10-27 09:56:14 +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!155
No description provided.