refactor(occupancy): response model typing, callback signatures, and holiday request schema hygiene #229
Labels
No labels
blocked
bug
enhancement
high-priority
low-priority
needs-info
needs-triage
ready-for-agent
ready-for-human
referenced
research
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
gabogg/hikcentral#229
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
Follow-up for PR #177 (next-day settings activation, #114) addressing pass-3 review findings P3-E, P3-F, P3-H, and P3-I:
Scope
__getitem__/getdict shims "for test callers", which acts as a back door around §2.3. Replace with direct attribute access across test callers. UsePendingChangeType/ Literals forstatusandchange_type. Add typed payload models for pending changes.occupancy_service.py,reeval_callback: Anyshould be typed asCallable[[aiosqlite.Connection, float], Awaitable[None]] | None.now_epochis currently unused inget_trusted_calibration_history_conn_async, makingnow_epochon multiplier refresh redundant. Either implement the boundary cutoff or remove the dead parameter.HolidayItemis currently used as the POST body schema but carries response-only fields (status,pending_change_id,notice_*), allowing clients to send these fields which are then stored in pending payloads. Separate into distinct request (HolidayCreateRequest) and response models.Acceptance Criteria
__getitem__/get); callers access attributes directly.reeval_callbacksignature is typed asCallable[[aiosqlite.Connection, float], Awaitable[None]] | None.HolidayItemrequest schema excludes response-only attributes (status,pending_change_id,notice_*).now_epochin repository calibration query is either active or cleaned up cleanly.Refs #177, #114.