Skip to content

Peripherals v1: SDK 0.3.0 runtime - #9

Merged
MarkParker5 merged 62 commits into
developfrom
feature/sdk-runtime
Oct 30, 2026
Merged

MarkParker5 merged 62 commits into
developfrom
feature/sdk-runtime

Conversation

@MarkParker5

Copy link
Copy Markdown
Member

Part of the peripherals v1 wave (SDK 0.3.0): one Peripheral protocol for every radio, service, provider and integration, a frozen shared Platform, runtime-owned lifecycle and retries, and typed static keys (Need[T], SettingsExtraField, ComposeService).

  • Ported to the SDK 0.3.0 peripheral API: peripherals(platform) entry point, self.platform / self.output, typed needs

Needs majordom-integration-sdk 0.3.0 on PyPI: CI installs the released SDK, so it stays red until the SDK PR is merged and released. Merge and release order: SDK → integrations → Hub.

Reviewed.

The bound link's dialect picks the zigpy library, ZigBeeSettings carry
the network and transmit power, and probe() recognises sticks of every
zigpy backend for the hub. Drops the env vars.
zigpy only emits connection_lost and doesn't reconnect; after the radio
service restarted, the coordinator stayed dead behind a failing watchdog.
The SDK needs it (type parameter defaults). CI tests 3.13 only. Not
relocked: the lock follows the SDK 0.3.0 release.
The package exports peripherals(platform), the settings are a nested
model the constructor takes, and a lost radio fails the controller
through the runtime instead of an integration error.
The runtime stops the controller from the task that reports the lost
radio: stop() cancelled and gathered that task too, which hung the loop.
The runtime stops a controller whose start failed and starts the same
instance again: stop() no longer assumes a radio was opened, nor closes
the one of a previous run twice.
The package exports ZigpyDriver beside the controller for the runtime's
USB scanner, in place of the controller's probe().
Devices and discoveries are scoped by the key. The runtime reacts to a
report in its own task, so stop() no longer spares the current one.
zigpy's new() starts the radio before it returns the application, so a
start that failed or was cut short left it out of stop()'s reach. Create
it without the radio first, as ZHA does, then start it.
A stop the runtime abandons inside shutdown() kept the dead application
and the old session's discoveries, and every later stop waited on it.
A replugged stick or a restarted service in front of the radio no longer
counts as a crash: Zigbee reopens the radio with backoff and reports it
lost (is_still_running=False) only once every attempt in a row failed.
An unplug stops Zigbee through its lost need, which ends the attempts.
Channel, PAN ID and extended PAN ID only ever applied when a network
was formed: they now show the network the radio runs, and a change to
them is refused. The network key is no longer a setting.
The need accepts only exact dialects, so the aliases and auto-probe of
the environment variable era were never reached.
The USB driver no longer probes for ziggurat, a server's WebSocket, and
zigpy-cc, which can't be installed next to zigpy 2, is gone.
ZigpyDriver tells the baud its probe found the stick at, and tries the
bauds zigpy-deconz and zigpy-blz still list the zigpy 1 way. The
controller opens the radio with its endpoint's baud and flow control.
This reverts commit cc86ebf: documentation goes to the docs repo.
@MarkParker5
MarkParker5 merged commit a6db867 into develop Oct 30, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant