From ba9f360283e3dea3ba1bd2f4880c60dec9c46ecf Mon Sep 17 00:00:00 2001 From: Christian Uhl Date: Tue, 29 Dec 2020 13:05:29 +0100 Subject: [PATCH] implements https://github.com/aholstenson/miio/pull/297 --- lib/.DS_Store | Bin 0 -> 6148 bytes lib/devices/gateway.js | 8 +++++++- lib/models.js | 7 ++++++- package-lock.json | 2 +- package.json | 2 +- 5 files changed, 15 insertions(+), 4 deletions(-) create mode 100644 lib/.DS_Store diff --git a/lib/.DS_Store b/lib/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..e2f844086f35cb496368a465131fef4fc4b6cca8 GIT binary patch literal 6148 zcmeHKOR54v3`|r|cpH~4`wHHm5k0|N;DO3R5Cuiov+`UX&B_N+MmG=KNClGWPN#a9 zT1+M)qO;R#Dl!(45!_HN7P@BV<{j&0MuBkLv6QtO&&^@C-FK>ACyYCk6?kXaJo0yc zaqDXuvs8czPys4H1*pJ36|mk58~p?_QUNMJ1?~#i_o2WIYhoMdpAG~c0e}Of-LUpq z0$3~otch(PGB6D)FsPa%h6Ww^l65t)4Gg+y4j-CN)|^n(pN{*Bmy6awMk+uBo)zfF zc5MBB0e>_9Ka;ql0#x9u6wtxEna}V_*;_j=XT7$-f8kbhg_~jR6a;U_KySy`SUaA0 bQPdS%=|KJrm@YIb@M#5ZGP4zt literal 0 HcmV?d00001 diff --git a/lib/devices/gateway.js b/lib/devices/gateway.js index 811c519..e688523 100644 --- a/lib/devices/gateway.js +++ b/lib/devices/gateway.js @@ -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