Repository navigation
Peripherals v1: SDK 0.3.0 runtime - #10
Merged
Merged
Conversation
# Conflicts: # pyproject.toml
The checklist asks for every external thing as a need, read from self.peripherals, and app services from self.platform.
The SDK needs it (type parameter defaults). CI tests 3.13 only.
The package exports peripherals(platform): the server it provides and the controller that needs it. Settings are the controller's typed nested model, applied in place; the controller no longer restarts the server.
Platform facts replace the context (platform_facts_did_change), the tests set a recording output on the controller and seed devices under its key.
The bound-needs fixture is renamed to bound, so it no longer shadows the package's peripherals().
The settings hook no longer raises on the lost connection, which made the runtime count an outage it heals by itself as a failure.
The runtime stops a controller whose start failed and starts the same object again later: stop() now finds no keeper or connection instead of raising, and leaves the object as the constructor did.
The platform facts hook asked for a restart on any change: a Thread network learned or a new Wi-Fi network restarted the integration for a fact it never reads.
A server restarted on purpose (recreated with new settings) is usually back by the first attempt, so it no longer flashes an error in the app.
Anything but a lost connection ended the keeper silently: the integration stayed running without hearing the server, and stop() raised the error before closing the connection. The keeper now reports an error that isn't still running, which the runtime turns into a restart.
Its greeting goes into its compose command, so a change recreates the container and the controller reconnects instead of restarting.
A required field makes the controller impossible to build, so the user never gets to enter it.
A newline in it reached the server as a second protocol command.
The constructor's Settings annotation no longer needs the future import, and every public name comes from the SDK's top level.
List every output call, point at the virtual server as the worked example, and drop the TODO bodies and capability fakes that are gone.
The dev runner the package docstring offers needs the runtime extra, and the tests run the controller under the runtime too.
The comment said the template ignores poetry.lock; it tracks it.
# Conflicts: # pyproject.toml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part of the peripherals v1 wave (SDK 0.3.0): one
Peripheralprotocol for every radio, service, provider and integration, a frozen sharedPlatform, runtime-owned lifecycle and retries, and typed static keys (Need[T],SettingsExtraField,ComposeService).peripherals(platform)entry point,self.platform/self.output, typed needsNeeds
majordom-integration-sdk0.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.