Manager¶
System-level services: CoreManager (plugin-to-plugin RPC, FFmpeg, signed requests), DeviceManager (cameras, discovered cameras), DownloadManager (one-shot download tokens).
camera_ui_sdk.manager ¶
CoreManagerEvent ¶
Bases: TypedDict
Core manager event payload.
Emitted when a core system event occurs (e.g. cloud account changes,
remote-server availability, plugin lifecycle changes). Subscribe via
coreManager.onEvent to react to system-level state changes.
CoreManager ¶
Bases: Protocol
Core manager interface for system-level operations.
Provides access to cross-cutting services like the FFmpeg binary path, server addresses, HMAC signing for cloud requests, inter-plugin lookup, and a stream of core system events.
Accessed via api.coreManager in plugins.
Example
onEvent
property
¶
connectToPlugin
async
¶
Connect to another plugin by name.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
pluginName
|
str
|
Name of the plugin to connect to |
required |
Returns:
| Type | Description |
|---|---|
BasePlugin | None
|
Plugin instance or None if not found. Cast to specific interface as needed. |
getFFmpegPath
async
¶
Get the FFmpeg executable path.
Returns:
| Type | Description |
|---|---|
str
|
Path to FFmpeg binary |
getServerAddresses
async
¶
Get server addresses (IP addresses the server is listening on).
Returns:
| Type | Description |
|---|---|
list[str]
|
List of server addresses |
getCloudServerId
async
¶
Get the cloud server identity this server is registered as.
Returns the cloud server_id from the active cloud pairing, or an
empty string when the server is not connected to the cloud.
Returns:
| Type | Description |
|---|---|
str
|
Cloud server id, or an empty string if not paired |
getPluginsByInterface
async
¶
Get all active plugins that implement a specific interface.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
interfaceName
|
PluginInterface
|
Plugin interface name (e.g., 'ClipDetection') |
required |
Returns:
| Type | Description |
|---|---|
list[PluginInfo]
|
List of plugin info dicts with id, name, contract |
DeviceManager ¶
Bases: Protocol
Device manager interface for camera operations. Provides methods to get cameras and push discovered cameras.
Accessed via api.deviceManager in plugins.
Example
pushDiscoveredCameras
async
¶
Push discovered cameras to the backend. Use this when cameras are discovered asynchronously (e.g., after cloud login). Cameras will be immediately visible in the UI for adoption.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
cameras
|
list[DiscoveredCamera]
|
List of discovered cameras to push |
required |
getCamera
async
¶
Get a camera by ID or name.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
cameraIdOrName
|
str
|
Camera ID or name |
required |
Returns:
| Type | Description |
|---|---|
CameraDevice | None
|
Camera device or None if not found |
DiscoveredCamera ¶
Bases: TypedDict
Discovered camera from a discovery provider.
Represents a camera found during network scanning or cloud lookup that
can be adopted into the system. Push these via
deviceManager.pushDiscoveredCameras so the user can pick them in
the UI without waiting for the next discovery poll.
CreateDownloadOptions ¶
Bases: TypedDict
Options for creating a download.
cleanup
instance-attribute
¶
When the file on disk is deleted (registry always expires at TTL).
never(default): file persists; caller manages it.on-expiry: deleted at TTL. Can be fetched N times during the window — correct mode for notification images that fan out to multiple devices/recipients.on-download: deleted after first successful download OR on TTL, whichever first. One-shot mode for things like backup exports.
CreateStreamDownloadOptions ¶
Bases: CreateDownloadOptions
Options for creating a streaming download (progressive file tailing).
markerPath
instance-attribute
¶
Path to a marker file that signals export is still in progress.
DownloadToken ¶
Bases: TypedDict
Token returned after registering a download.
url
instance-attribute
¶
In-app, same-origin URL: /api/download/<token>.
Use for callers already authenticated against this server.
publicUrl
instance-attribute
¶
Externally-reachable, session-less URL the server publishes for
out-of-band fetchers (push-notification image attachments, FCM / APNs
payloads, share recipients). Shape: <externalUrl>/api/download/<token>
— the token in the URL is the auth. Empty string when the server has
no external URL configured (LAN-only deployments); fall back to
url for in-app callers.
DownloadManager ¶
Bases: Protocol
Download manager interface for token-based file downloads.
Allows plugins to register files for HTTP download via a token URL. No JWT authentication is needed — the token itself is the auth.
Accessed via api.downloadManager in plugins.
Example
createDownload
async
¶
Register a file for download and get a token-based URL.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
options
|
CreateDownloadOptions
|
Download options |
required |
Returns:
| Type | Description |
|---|---|
DownloadToken
|
Token, URL, and expiry information |
createStreamDownload
async
¶
Register a streaming file for progressive download.
The file is tailed during writing; the marker file signals completion.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
options
|
CreateStreamDownloadOptions
|
Streaming download options (includes markerPath) |
required |
Returns:
| Type | Description |
|---|---|
DownloadToken
|
Token, URL, and expiry information |
deleteDownload
async
¶
Remove a download token and optionally delete the file.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
token
|
str
|
The download token to remove |
required |
NotificationManager ¶
Bases: Protocol
Notification manager interface for publishing notifications into the host.
Plugins call publish to ask the host to fan a Notification out to
every installed Notifier-plugin and the
in-app UI. The host applies user settings (master toggle, per-source
toggle, quiet hours) and the publishing plugin's declared capabilities;
calls from plugins without
:attr:PluginCapability.PublishNotifications are silently dropped.
Accessed via api.notificationManager in plugins.
Example
publish
async
¶
Send a notification to the host for fan-out to every installed Notifier-plugin and the in-app UI.
Resolves once the publish was handed to the transport. Downstream delivery is async and failures there never propagate back here.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
notification
|
Notification
|
Notification payload to publish. |
required |