UNPKG

@koush/ring-client-api

Version:

Unofficial API for Ring doorbells, cameras, security alarm system and smart lighting

27 lines (26 loc) 1.02 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.ContactSensor = void 0; const base_device_accessory_1 = require("./base-device-accessory"); const hap_1 = require("./hap"); class ContactSensor extends base_device_accessory_1.BaseDeviceAccessory { constructor(device, accessory, logger, config) { super(); this.device = device; this.accessory = accessory; this.logger = logger; this.config = config; const { Characteristic: { ContactSensorState }, Service, } = hap_1.hap; this.registerCharacteristic({ characteristicType: ContactSensorState, serviceType: Service.ContactSensor, getValue: (data) => { return data.faulted ? ContactSensorState.CONTACT_NOT_DETECTED : ContactSensorState.CONTACT_DETECTED; }, }); this.initSensorService(Service.ContactSensor); } } exports.ContactSensor = ContactSensor;