You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Improve error handling and add comprehensive client tests (#2007)
## Summary
- Fix `get_current_execution` crashing on empty responses (cloud returns
`{}`, local returns `[]` or `null`)
- Make `ActionGroup.id` and `ActionGroup.oid` optional (`str | None`) —
inline action groups from `exec/current` don't carry identifiers
- Add `start_time`, `execution_type`, and `execution_sub_type` fields to
`Execution` model (matching real API responses)
- Change `Execution.state` from `str` to `ExecutionState` enum
(consistent with `HistoryExecution`)
- Add `NoSuchDeviceError` and `NoSuchActionGroupError` exception types
with response handler mappings
- Add 8 new cloud exception fixture tests and 6 new cloud exception JSON
fixtures
- Add 13 cloud client tests covering executions, history, state, places,
action groups, and event listeners
- Add 10 local API tests verifying proper error handling for KizOs
gateway differences
## Breaking changes
- `Execution.state` is now `ExecutionState` instead of `str`,
`ActionGroup.id` and `ActionGroup.oid` are now `str | None` instead of
`str`, `get_current_execution` now returns `Execution | None` instead of
`Execution`
## Test plan
- [x] All 311 unit tests pass
- [x] All prek checks pass (ruff, mypy, ty)
- [x] Validated against real Somfy cloud API (37/37 probes pass)
- [x] Validated against real local KizOs gateway (37/37 probes pass)
- [x] JSON fixtures verified against real API response structures
0 commit comments