Skip to content

Commit

Permalink
implements aholstenson#297
Browse files Browse the repository at this point in the history
  • Loading branch information
Christian Uhl authored and Christian Uhl committed Dec 29, 2020
1 parent b82fa53 commit ba9f360
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 4 deletions.
Binary file added lib/.DS_Store
Binary file not shown.
8 changes: 7 additions & 1 deletion lib/devices/gateway.js
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,13 @@ const Gateway = Thing.type(Parent => class Gateway extends Parent.with(MiioApi,
return id;
}

return this.call('get_device_prop', [ 'lumi.0', 'device_list' ])
let listCommand = 'device_list';
if(id.includes('mgl03')) {
listCommand = 'get_device_list';
}

return this.call('get_device_prop', [ 'lumi.0', listCommand ])

.then(list => {
const defs = [ ...this.extraChildren ];
for(let i=0; i<list.length; i+=5) {
Expand Down
7 changes: 6 additions & 1 deletion lib/models.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,11 @@ module.exports = {

// Air Purifier 2S
'zhimi.airpurifier.ma2': AirPurifier,

'zhimi.airpurifier.mc1': AirPurifier,

// Air Purifier 2H
'zhimi.airpurifier.mc2': AirPurifier,

'zhimi.humidifier.v1': Humidifier,

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

'lumi.gateway.v2': Gateway.WithLightAndSensor,
'lumi.gateway.v3': Gateway.WithLightAndSensor,
'lumi.gateway.mgl03': Gateway.WithLightAndSensor,
'lumi.acpartner.v1': Gateway.Basic,
'lumi.acpartner.v2': Gateway.Basic,
'lumi.acpartner.v3': Gateway.Basic,
Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

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

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "miio",
"version": "0.15.4",
"version": "0.15.9",
"license": "MIT",
"description": "Control Mi Home devices, such as Mi Robot Vacuums, Mi Air Purifiers, Mi Smart Home Gateway (Aqara) and more",
"repository": "aholstenson/miio",
Expand Down

0 comments on commit ba9f360

Please sign in to comment.