homebridge-loxone-proxy
Version:
Homebridge Dynamic Platform Plugin which exposes a Loxone System to Homekit.
49 lines • 1.79 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.Camera = void 0;
const StreamingDelegate_1 = require("../hksv/StreamingDelegate");
class Camera {
constructor(platform, accessory, ip, base64auth) {
this.platform = platform;
this.accessory = accessory;
this.ip = ip;
this.base64auth = base64auth;
const hksvEnabled = true;
this.setupService();
if (hksvEnabled) {
this.startHKSVStream().catch(err => {
this.platform.log.error(`Failed to start HKSV stream: ${err}`);
});
}
}
setupService() {
const delegate = new StreamingDelegate_1.streamingDelegate(this.platform, this.ip, this.base64auth);
this.accessory.configureController(delegate.controller);
}
async startHKSVStream() {
try {
this.platform.log.debug(`Started HKSV stream for ${this.accessory.displayName}`);
}
catch (error) {
this.platform.log.error(`Failed to start HKSV stream for ${this.accessory.displayName}: ${error}`);
}
}
async stopHKSVStream() {
try {
this.platform.log.debug(`Stopped HKSV stream for ${this.accessory.displayName}`);
}
catch (error) {
this.platform.log.error(`Failed to stop HKSV stream for ${this.accessory.displayName}: ${error}`);
}
}
async handleMotionDetection() {
try {
this.platform.log.debug(`Motion detected on ${this.accessory.displayName}`);
}
catch (error) {
this.platform.log.error(`Failed to handle motion detection for ${this.accessory.displayName}: ${error}`);
}
}
}
exports.Camera = Camera;
//# sourceMappingURL=Camera.js.map