Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update models.js #297

Open
wants to merge 16 commits into
base: master
Choose a base branch
from
7 changes: 6 additions & 1 deletion lib/devices/gateway.js
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,12 @@ 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
4 changes: 4 additions & 0 deletions lib/models.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ module.exports = {

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

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

'zhimi.humidifier.v1': Humidifier,

Expand All @@ -44,6 +47,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.6",
"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