UNPKG

homebridge-zigbee-v2

Version:

ZigBee Platform plugin for HomeBridge

37 lines (32 loc) 785 B
const HomeKitDevice = require('../HomeKitDevice') class NexturnMotionSensor extends HomeKitDevice { static get description() { return { model: 'Motion_Sensor', manufacturer: 'Nexturn', name: 'Megafon Motion Sensor', } } getAvailbleServices() { return [{ name: 'Motion', type: 'MotionSensor', history: 'motion', }, { name: 'Battery', type: 'BatteryService', }] } onDeviceReady() { this.zigbee.unstableAISZoneEnroll(1) this.unstableStatusMountServiceCharacteristic({ endpoint: 1, cluster: 'ssIasZone', service: 'Motion', characteristic: 'MotionDetected', status: 'zoneStatus', statusParser: data => data === 1, }) } } module.exports = NexturnMotionSensor