homebridge-unifi-protect
Version:
Homebridge UniFi Protect plugin providing complete HomeKit integration for the entire UniFi Protect ecosystem with full support for most features including HomeKit Secure Video, multiple controllers, blazing fast performance, and much more.
40 lines • 2.43 kB
JavaScript
/* Copyright(C) 2020-2025, HJD (https://github.com/hjdhjd). All rights reserved.
*
* protect-types.ts: Interface and type definitions for UniFi Protect.
*/
// Useful utilities.
export function toCamelCase(input) {
return input.replace(/(^\w|\s+\w)/g, match => match.toUpperCase());
}
export const ProtectDeviceCategories = ["camera", "chime", "light", "sensor", "viewer"];
// HBUP reserved names.
export var ProtectReservedNames;
(function (ProtectReservedNames) {
// Manage our contact sensor types.
ProtectReservedNames["CONTACT_AUTHSENSOR"] = "ContactAuthSensor";
ProtectReservedNames["CONTACT_MOTION_SMARTDETECT"] = "ContactMotionSmartDetect";
ProtectReservedNames["CONTACT_MOTION_SMARTDETECT_LICENSE"] = "ContactMotionSmartDetectLicense";
ProtectReservedNames["CONTACT_SENSOR"] = "ContactSensor";
ProtectReservedNames["CONTACT_SENSOR_ALARM_SOUND"] = "ContactAlarmSound";
// Manage our lightbulb types.
ProtectReservedNames["LIGHTBULB_DOORBELL_VOLUME"] = "ChimeVolume";
ProtectReservedNames["LIGHTBULB_NIGHTVISION"] = "NightVision";
ProtectReservedNames["LIGHTBULB_PACKAGE_FLASHLIGHT"] = "PackageCamera.Flashlight";
// Manage our lock types.
ProtectReservedNames["LOCK_ACCESS"] = "Access";
// Manage our switch types.
ProtectReservedNames["SWITCH_DOORBELL_CHIME_BUZZER"] = "DoorbellChime.buzzer";
ProtectReservedNames["SWITCH_DOORBELL_CHIME_DIGITAL"] = "DoorbellChime.digital";
ProtectReservedNames["SWITCH_DOORBELL_CHIME_MECHANICAL"] = "DoorbellChime.mechanical";
ProtectReservedNames["SWITCH_DOORBELL_CHIME_NONE"] = "DoorbellChime.none";
ProtectReservedNames["SWITCH_DOORBELL_CHIME_SPEAKER"] = "DoorbellChime.speaker";
ProtectReservedNames["SWITCH_DOORBELL_TRIGGER"] = "DoorbellTrigger";
ProtectReservedNames["SWITCH_HKSV_RECORDING"] = "HKSVRecordingSwitch";
ProtectReservedNames["SWITCH_MOTION_SENSOR"] = "MotionSensorSwitch";
ProtectReservedNames["SWITCH_MOTION_TRIGGER"] = "MotionSensorTrigger";
ProtectReservedNames["SWITCH_STATUS_LED"] = "StatusLedSwitch";
ProtectReservedNames["SWITCH_UFP_RECORDING_ALWAYS"] = "UFPRecordingSwitch.always";
ProtectReservedNames["SWITCH_UFP_RECORDING_DETECTIONS"] = "UFPRecordingSwitch.detections";
ProtectReservedNames["SWITCH_UFP_RECORDING_NEVER"] = "UFPRecordingSwitch.never";
})(ProtectReservedNames || (ProtectReservedNames = {}));
//# sourceMappingURL=protect-types.js.map