Skip to content

Commit

Permalink
v1.1.8 added Air Fresh VA4 and Aqara D1 Wirelles Switches
Browse files Browse the repository at this point in the history
  • Loading branch information
Maxmudjon committed Oct 25, 2020
1 parent 688efe9 commit 55c2016
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 23 deletions.
20 changes: 10 additions & 10 deletions drivers/ctrl_ln2.aq1/driver.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,45 +4,45 @@ const model = ["ctrl_ln2.aq1", "switch_b2nacn02"];
const initToggleFlowTriggers = (on, off, toggle) => ({
on: new Homey.FlowCardTriggerDevice(on).register(),
off: new Homey.FlowCardTriggerDevice(off).register(),
toggle: new Homey.FlowCardTriggerDevice(toggle).register()
toggle: new Homey.FlowCardTriggerDevice(toggle).register(),
});

const initFlowCondition = name => new Homey.FlowCardCondition(name).register();
const initFlowCondition = (name) => new Homey.FlowCardCondition(name).register();

const initToggleFlowAction = (on, off) => ({
on: new Homey.FlowCardAction(on).register(),
off: new Homey.FlowCardAction(off).register()
off: new Homey.FlowCardAction(off).register(),
});

class DoubleSwitchLN extends Homey.Driver {
onInit() {
this.triggers = {
left_switch: initToggleFlowTriggers("left_switch_on", "left_switch_off", "left_switch_toggle"),
right_switch: initToggleFlowTriggers("right_switch_on", "right_switch_off", "right_switch_toggle")
right_switch: initToggleFlowTriggers("right_switch_on", "right_switch_off", "right_switch_toggle"),
};
this.conditions = {
left_switch: initFlowCondition("left_switch_active"),
right_switch: initFlowCondition("right_switch_active")
right_switch: initFlowCondition("right_switch_active"),
};
this.actions = {
left_switch: initToggleFlowAction("left_switch_on", "left_switch_off"),
right_switch: initToggleFlowAction("right_switch_on", "right_switch_off")
right_switch: initToggleFlowAction("right_switch_on", "right_switch_off"),
};
}

onPairListDevices(data, callback) {
if (Homey.app.mihub.hubs) {
Homey.app.mihub
.getDevicesByModel(model)
.then(devices =>
.then((devices) =>
callback(
null,
devices.map(device => {
devices.map((device) => {
return {
name: device.name + " | " + device.sid,
data: {
sid: device.sid
}
sid: device.sid,
},
};
})
)
Expand Down
12 changes: 6 additions & 6 deletions drivers/db86_switch_advanced/driver.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
const Homey = require("homey");
const model = ["remote.b286acn01"];
const model = ["remote.b286acn01", "lumi.remote.b286acn02", "remote.b286acn02"];

class DoubleButton86SwitchAdvanced extends Homey.Driver {
onInit() {
Expand All @@ -10,23 +10,23 @@ class DoubleButton86SwitchAdvanced extends Homey.Driver {
right_click: new Homey.FlowCardTriggerDevice("right_click_button_switch").register(),
right_double_click: new Homey.FlowCardTriggerDevice("right_double_click_click_button_switch").register(),
right_long_click_press: new Homey.FlowCardTriggerDevice("right_long_click_press_click_button_switch").register(),
both_click: new Homey.FlowCardTriggerDevice("both_click_click_press_click_button_switch").register()
both_click: new Homey.FlowCardTriggerDevice("both_click_click_press_click_button_switch").register(),
};
}

onPairListDevices(data, callback) {
if (Homey.app.mihub.hubs) {
Homey.app.mihub
.getDevicesByModel(model)
.then(devices =>
.then((devices) =>
callback(
null,
devices.map(device => {
devices.map((device) => {
return {
name: device.name + " | " + device.sid,
data: {
sid: device.sid
}
sid: device.sid,
},
};
})
)
Expand Down
12 changes: 6 additions & 6 deletions drivers/sb86_switch/driver.js
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
const Homey = require("homey");
const model = ["86sw1"];
const model = ["86sw1", "lumi.remote.b186acn02", "remote.b186acn02"];

class DoubleButton86Switch extends Homey.Driver {
onInit() {
this.triggers = {
click: new Homey.FlowCardTriggerDevice("click_sb86_switch").register()
click: new Homey.FlowCardTriggerDevice("click_sb86_switch").register(),
};
}

onPairListDevices(data, callback) {
if (Homey.app.mihub.hubs) {
Homey.app.mihub
.getDevicesByModel(model)
.then(devices =>
.then((devices) =>
callback(
null,
devices.map(device => {
devices.map((device) => {
return {
name: device.name + " | " + device.sid,
data: {
sid: device.sid
}
sid: device.sid,
},
};
})
)
Expand Down
4 changes: 3 additions & 1 deletion node_modules/mimorelinks/libs/DeviceParser.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 55c2016

Please sign in to comment.