Repository navigation
python-sdk: 0.1.1 — top-level type exports and transport leak fix - #2109
Merged
Merged
Conversation
- re-export ScryptedInterface, ScryptedDeviceType, ScryptedInterfaceProperty, ScryptedInterfaceMethods, ScryptedMimeTypes, and PluginRemote from the package root so consumers don't need the generated scrypted_sdk.scrypted_python.scrypted_sdk.types path - close a caller-provided transport when the login phase fails, instead of leaking its session and send-loop task (engine.io and handshake failures already closed it) - extend the CI smoke test to cover the new exports Co-Authored-By: Claude Fable 5 <[email protected]>
raman325
marked this pull request as draft
July 31, 2026 18:31
Exposes the full generated type surface (245 names) at a stable short path — from scrypted_sdk.types import VideoClip, LockState, ... — without star-exporting into the package root, where DeviceManager/MediaManager/ SystemManager from the type tree would collide with the concrete plugin_remote implementations. Co-Authored-By: Claude Fable 5 <[email protected]>
raman325
marked this pull request as ready for review
August 1, 2026 00:25
_login owns the request error translation and temporary-session cleanup, leaving connect_scrypted_client a single flat try/except for closing a caller-provided transport on login failure. Co-Authored-By: Claude Fable 5 <[email protected]>
koush
approved these changes
Aug 1, 2026
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.
Small follow-ups from integrating the published 0.1.0 package into the Home Assistant integration:
Changes
ScryptedInterface,ScryptedDeviceType,ScryptedInterfaceProperty,ScryptedInterfaceMethods,ScryptedMimeTypes, andPluginRemoteare now re-exported from the package root. Previously the only import path for the types wasscrypted_sdk.scrypted_python.scrypted_sdk.types(an artifact of the build-time package generation), which every consumer would otherwise have to hardcode.scrypted_sdk.typesalias module: the full generated type surface (245 names — interface TypedDicts, settings types, all enums) is exposed at one stable short path:from scrypted_sdk.types import VideoClip, LockState, .... A star-export into the package root instead would collide: the type tree's abstractDeviceManager/MediaManager/SystemManagerwould shadow the concreteplugin_remoteimplementations exported there, so the root keeps only the curated names.connect_scrypted_clientclosed the transport on engine.io connect failure and handshake timeout, but not a caller-providedtransportwhen the login phase failed — leaking its aiohttp session and send-loop task. Login failures now close it too.Testing
uv build+ wheel install in a clean venv: all new top-level imports andscrypted_sdk.typesresolve; root managers verified to still be the concreteplugin_remoteclassesconnect_scrypted_clientagainst a dead host now has its send task torn down after the login failure (it stayed running on 0.1.0)After merge, publishing 0.1.1 is just Actions → Python SDK → Run workflow.
🤖 Generated with Claude Code