feat: Automatically recover from frozen live streams (#2569)
- Closes: #2099
This commit is contained in:
@@ -60,6 +60,7 @@ export class Camera {
|
||||
protected _eventCallback?: CameraEventCallback;
|
||||
protected _destroyCallbacks: DestroyCallback[] = [];
|
||||
protected _entity: Entity | null = null;
|
||||
protected _initialized = false;
|
||||
|
||||
constructor(
|
||||
config: CameraConfig,
|
||||
@@ -79,6 +80,10 @@ export class Camera {
|
||||
return this._entity;
|
||||
}
|
||||
|
||||
public isInitialized(): boolean {
|
||||
return this._initialized;
|
||||
}
|
||||
|
||||
async initialize(options: CameraInitializationOptions): Promise<Camera> {
|
||||
// Freeze a single HASS snapshot for the whole (async, multi-step)
|
||||
// initialization so every step observes a consistent entity world; live
|
||||
@@ -116,6 +121,7 @@ export class Camera {
|
||||
}
|
||||
}
|
||||
|
||||
this._initialized = true;
|
||||
return this;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user