Skip to content

Commit ba9f360

Browse files
Christian UhlChristian Uhl
authored andcommitted
implements aholstenson#297
1 parent b82fa53 commit ba9f360

5 files changed

Lines changed: 15 additions & 4 deletions

File tree

‎lib/.DS_Store‎

6 KB
Binary file not shown.

‎lib/devices/gateway.js‎

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,13 @@ const Gateway = Thing.type(Parent => class Gateway extends Parent.with(MiioApi,
140140
return id;
141141
}
142142

143-
return this.call('get_device_prop', [ 'lumi.0', 'device_list' ])
143+
let listCommand = 'device_list';
144+
if(id.includes('mgl03')) {
145+
listCommand = 'get_device_list';
146+
}
147+
148+
return this.call('get_device_prop', [ 'lumi.0', listCommand ])
149+
144150
.then(list => {
145151
const defs = [ ...this.extraChildren ];
146152
for(let i=0; i<list.length; i+=5) {

‎lib/models.js‎

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,11 @@ module.exports = {
3232

3333
// Air Purifier 2S
3434
'zhimi.airpurifier.ma2': AirPurifier,
35-
35+
'zhimi.airpurifier.mc1': AirPurifier,
36+
37+
// Air Purifier 2H
38+
'zhimi.airpurifier.mc2': AirPurifier,
39+
3640
'zhimi.humidifier.v1': Humidifier,
3741

3842
'chuangmi.plug.m1': PowerPlug,
@@ -44,6 +48,7 @@ module.exports = {
4448

4549
'lumi.gateway.v2': Gateway.WithLightAndSensor,
4650
'lumi.gateway.v3': Gateway.WithLightAndSensor,
51+
'lumi.gateway.mgl03': Gateway.WithLightAndSensor,
4752
'lumi.acpartner.v1': Gateway.Basic,
4853
'lumi.acpartner.v2': Gateway.Basic,
4954
'lumi.acpartner.v3': Gateway.Basic,

‎package-lock.json‎

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎package.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "miio",
3-
"version": "0.15.4",
3+
"version": "0.15.9",
44
"license": "MIT",
55
"description": "Control Mi Home devices, such as Mi Robot Vacuums, Mi Air Purifiers, Mi Smart Home Gateway (Aqara) and more",
66
"repository": "aholstenson/miio",

0 commit comments

Comments
 (0)