Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
},
8: {
motion: 'DoubleTap'
},
16: {
motion: 'Rotate'
},
32: {
motion: 'Catch'
},
};
const Homey = require('homey');
const util = require('./../../lib/util');
const ZigBeeDevice = require('homey-meshdriver').ZigBeeDevice;
class AqaraCubeSensor extends ZigBeeDevice {
async onMeshInit() {
// enable debugging
// this.enableDebug();
// print the node's info to the console
// this.printNode();
//Link util parseData method to this devices instance
this.parseData = util.parseData.bind(this)
// Register the AttributeReportListener - Shake, Catch, Flip 90, Flip 180, Slide and Double tap motionType
this.registerAttrReportListener('genMultistateInput', 'presentValue', 1, 60, null, this.motionAttribReport.bind(this), 1)
.catch(err => {
// Registering attr reporting failed
'use strict';
const Homey = require('homey');
const ZigBeeDevice = require('homey-meshdriver').ZigBeeDevice;
class MotionSensor extends ZigBeeDevice {
onMeshInit()
{
this.printNode();
if (this.hasCapability('alarm_motion')) this.registerCapability('alarm_motion', 'msOccupancySensing');
if (this.hasCapability('alarm_battery')) this.registerCapability('alarm_battery', 'genPowerCfg');
if (this.hasCapability('measure_temperature')) this.registerCapability('measure_temperature', 'msTemperatureMeasurement');
if (this.hasCapability('measure_luminance')) this.registerCapability('measure_luminance', 'msIlluminanceMeasurement');
if (this.hasCapability('measure_battery')) this.registerCapability('measure_battery', 'genPowerCfg');
// alarm_motion
this.minReportMotion = this.getSetting('minReportMotion') || 1;
this.maxReportMotion = this.getSetting('maxReportMotion') || 300;
idle: {
command: 'stop'
},
down: {
command: 'downClose'
},
};
// up: = upOpen = genAnalogOutput-presentValue / closuresWindowCovering-currentPositionLiftPercentage 100
// idle: = stop = genAnalogOutput-presentValue / closuresWindowCovering-currentPositionLiftPercentage ...
// down: = downClose = genAnalogOutput-presentValue / closuresWindowCovering-currentPositionLiftPercentage 0
const Homey = require('homey');
const util = require('./../../lib/util');
const ZigBeeDevice = require('homey-meshdriver').ZigBeeDevice;
class AqaraCurtain extends ZigBeeDevice {
onMeshInit() {
// enable debugging
this.enableDebug();
// print the node's info to the console
// this.printNode();
//Link util parseData method to this devices instance
this.parseData = util.parseData.bind(this)
this.registerCapability('onoff', 'genOnOff');
if (this.hasCapability('windowcoverings_state')) {
'use strict';
const Homey = require('homey');
const util = require('./../../lib/util');
const ZigBeeDevice = require('homey-meshdriver').ZigBeeDevice;
let lastKey = null;
class AqaraRemoteb186acn01 extends ZigBeeDevice {
async onMeshInit() {
// enable debugging
// this.enableDebug();
// print the node's info to the console
// this.printNode();
//Link util parseData method to this devices instance
this.parseData = util.parseData.bind(this)
// supported scenes and their reported attribute numbers (all based on reported data)
'use strict';
const util = require('./../../lib/util');
const ZigBeeDevice = require('homey-meshdriver').ZigBeeDevice;
class XiaomiTempSensor extends ZigBeeDevice {
onMeshInit() {
// enable debugging
// this.enableDebug();
// print the node's info to the console
// this.printNode();
//Link util parseData method to this devices instance
this.parseData = util.parseData.bind(this)
// Register the AttributeReportListener for measure_temperature
this._attrReportListeners['0_msTemperatureMeasurement'] = this._attrReportListeners['0_msTemperatureMeasurement'] || {};
this._attrReportListeners['0_msTemperatureMeasurement']['measuredValue'] =
this.onTemperatureReport.bind(this);
//lifeline validated
'use strict';
const Homey = require('homey');
const util = require('./../../lib/util');
const ZigBeeDevice = require('homey-meshdriver').ZigBeeDevice;
let lastKey = null;
class AqaraRemoteb1acn01 extends ZigBeeDevice {
async onMeshInit() {
// enable debugging
// this.enableDebug();
// print the node's info to the console
// this.printNode();
//Link util parseData method to this devices instance
this.parseData = util.parseData.bind(this)
// supported scenes and their reported attribute numbers (all based on reported data)
'use strict';
const util = require('./../../lib/util');
const ZigBeeDevice = require('homey-meshdriver').ZigBeeDevice;
class XiaomiHumanBodySensor extends ZigBeeDevice {
onMeshInit() {
// enable debugging
// this.enableDebug();
// print the node's info to the console
// this.printNode();
//Link util parseData method to this devices instance
this.parseData = util.parseData.bind(this)
// Register attribute listener for occupancy
this._attrReportListeners['0_msOccupancySensing'] = this._attrReportListeners['0_msOccupancySensing'] || {};
this._attrReportListeners['0_msOccupancySensing']['occupancy'] = this.onOccupancyReport.bind(this);
'use strict';
const util = require('./../../lib/util');
const ZigBeeDevice = require('homey-meshdriver').ZigBeeDevice;
class AqaraHumanBodySensor extends ZigBeeDevice {
onMeshInit() {
// enable debugging
// this.enableDebug();
// print the node's info to the console
// this.printNode();
//Link util parseData method to this devices instance
this.parseData = util.parseData.bind(this)
// Register attribute listener for occupancy
this.registerAttrReportListener('msOccupancySensing', 'occupancy', 1, 60, null,
this.onOccupancyReport.bind(this), 0)
.catch(err => {
'use strict';
const util = require('./../util');
const ZigBeeDevice = require('homey-meshdriver').ZigBeeDevice;
const maxHue = 254;
const maxSaturation = 254;
class ZigBeeLightDevice extends ZigBeeDevice {
async onMeshInit() {
// Register capabilities if present on device
if (this.hasCapability('onoff')) this.registerCapability('onoff', 'genOnOff');
if (this.hasCapability('dim')) this.registerCapability('dim', 'genLevelCtrl');
// Register debounced capabilities
const groupedCapabilities = [];
if (this.hasCapability('light_hue')) {
groupedCapabilities.push({
'use strict';
const ZigBeeDevice = require('homey-meshdriver').ZigBeeDevice;
class AqaraWallSwitchSingleL extends ZigBeeDevice {
onMeshInit() {
// enable debugging
// this.enableDebug();
// print the node's info to the console
// this.printNode();
// Register capabilities and reportListeners for switch
this.registerCapability('onoff', 'genOnOff', {
endpoint: 1
});
this.registerAttrReportListener('genOnOff', 'onOff', 1, 3600, 1,