Skip to content

Commit c8af23e

Browse files
committed
1.1.5 added Yeelight lights, MI plug
1 parent 2c97819 commit c8af23e

File tree

6 files changed

+19
-13
lines changed

6 files changed

+19
-13
lines changed

README.md

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
Added support for Mi Gateways child devices.
44

5-
## Version 1.1.4 - Supported devices:
5+
## Version 1.1.5 - Supported devices:
66

77
### Zigbee subdevices Xiaomi Gateway
88

@@ -38,10 +38,10 @@ Added support for Mi Gateways child devices.
3838

3939
### Wifi devices
4040

41-
- Yeelight Color Bulb V1/V2.
41+
- Yeelight Color Bulb V1/V2/V3.
4242
- Yeelight White Bulb.
4343
- Yeelight Ceiling Lamp.
44-
- Yeelight Bedside Lamp.
44+
- Yeelight Bedside Lamp V1/V2.
4545
- Yeelight Light Strip V1/V2.
4646
- Yeelight Jiaoyue 650.
4747
- Yeelight Jiaoyue 450.
@@ -127,6 +127,12 @@ Added support for Mi Gateways child devices.
127127

128128
## Version logs
129129

130+
### 1.1.5 (9.06.2020)
131+
132+
1. added support for Yeelight Color Bulb V3.
133+
2. added support for Yeelight Bedside Lamp V2.
134+
3. added support for Xiaomi Chuangmi Plug (M3), Mi Smart Plug (HMI205).
135+
130136
### 1.1.4 (23.05.2020)
131137

132138
1. added Mi Air Humidifier 2 (mi_humidifier_cb1).

app.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"id": "com.maxmudjon.mihomey",
3-
"version": "1.1.4",
3+
"version": "1.1.5",
44
"compatibility": ">=2.0.0",
55
"sdk": 2,
66
"name": {

drivers/chuangmi_plug_m1/driver.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ class MiSmartPlugWiFi extends Homey.Driver {
1616
device
1717
.call("miIO.info", [])
1818
.then(value => {
19-
if (value.model == this.data.model) {
19+
if (value.model == this.data.model || value.model == "chuangmi.plug.m3" || value.model == "chuangmi.plug.hmi205") {
2020
pairingDevice.data.id = "PL:UG:M1:" + value.mac + ":PL:UG:M1";
2121
device
2222
.call("get_prop", ["power"])

drivers/ctrl_neutral1/device.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ class SingleSwitch extends Homey.Device {
9898
let sid = this.data.sid;
9999
this.registerCapabilityListener(name, async value => {
100100
const newValue = value ? valueOn : valueOff;
101-
const data = { status: newValue };
101+
const data = { channel_0: newValue };
102102
await Homey.app.mihub.sendWrite(sid, data);
103103
this.triggerFlow(trigger, name, value);
104104
});
@@ -110,12 +110,12 @@ class SingleSwitch extends Homey.Device {
110110

111111
registerToggleAction(name, valueOn = true, valueOff = false, action) {
112112
action.on.registerRunListener(async (args, state) => {
113-
const data = { status: valueOn };
113+
const data = { channel_0: valueOn };
114114
await Homey.app.mihub.sendWrite(args.device.data.sid, data);
115115
return true;
116116
});
117117
action.off.registerRunListener(async (args, state) => {
118-
const data = { status: valueOff };
118+
const data = { channel_0: valueOff };
119119
await Homey.app.mihub.sendWrite(args.device.data.sid, data);
120120
return true;
121121
});

drivers/yeelight_light_bslamp1/driver.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ class YeelightBedsideLamp extends Homey.Driver {
2626
device
2727
.call("miIO.info", [])
2828
.then(value => {
29-
if (value.model == this.data.model) {
29+
if (value.model == this.data.model || value.model == "yeelink.light.bslamp2") {
3030
pairingDevice.data.id = "YL:BS:L1:" + value.mac + ":YL:BS:L1";
3131
device
3232
.call("get_prop", ["bright"])

drivers/yeelight_light_color1/driver.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,15 +23,15 @@ class YeelightColorBulb extends Homey.Driver {
2323
pairingDevice.settings = {};
2424
pairingDevice.data = {};
2525

26-
socket.on("connect", function (data, callback) {
26+
socket.on("connect", (data, callback) => {
2727
this.data = data;
2828
miio
2929
.device({ address: data.ip, token: data.token })
3030
.then(device => {
3131
device
3232
.call("miIO.info", [])
3333
.then(value => {
34-
if (value.model == this.data.model || value.model == 'yeelink.light.color2') {
34+
if (value.model == this.data.model || value.model == "yeelink.light.color2" || value.model == "yeelink.light.color3") {
3535
pairingDevice.data.id = "YL:CB:" + value.mac + ":YL:CB";
3636
device
3737
.call("get_prop", ["bright"])
@@ -63,7 +63,7 @@ class YeelightColorBulb extends Homey.Driver {
6363
})
6464
.catch(error => callback(null, error));
6565
})
66-
.catch(function (error) {
66+
.catch(error => {
6767
if (error == "Error: Could not connect to device, handshake timeout") {
6868
callback(null, "timeout");
6969
}
@@ -74,7 +74,7 @@ class YeelightColorBulb extends Homey.Driver {
7474
}
7575
});
7676
});
77-
socket.on("done", function (data, callback) {
77+
socket.on("done", (data, callback) => {
7878
callback(null, pairingDevice);
7979
});
8080
}

0 commit comments

Comments
 (0)