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
Add support for schema 47 state properties and events (1/4) (#1404)
* Add support for schema 47 state properties and events (1/4)
Mirrors upstream PR #1509. This is the first of four PRs that together
add full schema 47 support; the subsequent three add the new commands
(driver, controller/node/endpoint, zniffer/utility/broadcast).
Bumps both MIN_SERVER_SCHEMA_VERSION and MAX_SERVER_SCHEMA_VERSION to
47, since HA will rely on the new state properties as load-bearing.
State properties added:
- Driver.ready / all_nodes_ready / config_version (new Driver.data dict
populated from state["driver"], plus Driver.update() symmetric with
Controller.update())
- Controller.is_sis / max_payload_size / max_payload_size_lr /
zwave_api_version / zwave_chip_type
- Node.can_sleep / supports_wake_up_on_demand / hardware_version /
has_suc_return_route / manufacturer / dsk
Events added:
- Driver: bootloader ready, error (with error payload)
- Controller: network found (with homeId/ownNodeId), network joined,
network left, joining network failed, leaving network failed
State mutations on event handlers:
- handle_driver_ready -> data["ready"] = True
- handle_all_nodes_ready -> data["allNodesReady"] = True
- handle_network_found is currently a no-op; whether it should mutate
data["homeId"]/["ownNodeId"] from the event payload (vs. waiting for
network joined or a fresh state dump) is an open question for upstream
review.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* Address Copilot review on #1404
- Rename unused `event` param to `_event` on `handle_error` and
`handle_bootloader_ready` for consistency with `handle_driver_ready` /
`handle_all_nodes_ready` (which were already renamed in this branch).
- Move the `handle_network_found` open design question out of the
user-facing docstring and into a TODO code comment. The docstring now
documents current behavior succinctly.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* Address review: unify ZWaveChipType and add test annotations
Addresses MartinHjelmare's review comments on #1404:
1. Replace `str | UnknownZWaveChipTypeDataType | None` return type on
`Controller.zwave_chip_type` with a unified `ZWaveChipType` frozen
dataclass. Known chips set `name`; unknown chips set `type`/`version`.
Includes `from_dict` classmethod following the codebase convention.
2. Add complete type annotations (parameter types + `-> None`) to all
new test functions in test_driver.py, test_controller.py, and
test_node.py.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
0 commit comments