✨ feat: set_thermal_control(thermal_control_id, device_id, set_point, mode) #174
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/thermal-control-write"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
This issue was presumed blocked ("no thermal device reachable, shapes unconfirmed") — but a 2026-10-27 enum-binding oracle (probing the validation layer against a nonexistent id, no real resource touched) live-verified the body skeleton: the inline
deviceobject REQUIRES the Jackson discriminator"@class": "Device"+ numeric id (else400 "Failed to read request");deviceis the only required field;setPoint/modeare optional; validation runs before the path lookup. The{id}is the thermal-control config id (a device id 404s), obtained fromget_thermal_control(device_id)on devices that have one. The client coercesint(device_id)so string ids serialize numerically. Still honestly documented: the success path is unverified (no thermal-control config exists on the probe account) andmodevalues are unconfirmed at this endpoint (capacity-level enum: OFF/HEAT/COOL). Field notes updated with the findings (incl. GET by-id → 405).Evidence
AttributeError— the write path was not exposed; the body shape was a total unknown.modeABSENT from the body, string device id serializing as JSON number 7, 500 →ComwattAPIError), TDD red→green;pytest= 224 passed;mypyclean. Reviewer verdicts: spec PASS, quality PASS; one fix round (int coercion — spec-originated Important, controller-ruled) scoped re-reviewed PASS.Merge Danger
Door: two-way — additive method; revert removes it.
Blast Radius: low — one new public write method; the discriminator quirk is built in, not caller-facing.
Closes #108
WIP: ✨ feat: set_thermal_control(thermal_control_id, device_id, set_point, mode)to ✨ feat: set_thermal_control(thermal_control_id, device_id, set_point, mode)