acc-ua / homebridge-xiaomi-humidifier

Xiaomi Humidifier plugin for HomeBridge.
9 stars 9 forks source link

Plugin error miio.Device #7

Open h3roin opened 6 years ago

h3roin commented 6 years ago

/usr/local/lib/node_modules/homebridge-xiaomi-humidifier/Devices/MiHumidifier.js:17 this.device = new miio.Device({ ^

TypeError: miio.Device is not a constructor at new MiHumidifier (/usr/local/lib/node_modules/homebridge-xiaomi-humidifier/Devices/MiHumidifier.js:17:19) at MiHumidifierPlatform.accessories (/usr/local/lib/node_modules/homebridge-xiaomi-humidifier/index.js:85:21) at Server._loadPlatformAccessories (/usr/local/lib/node_modules/homebridge/lib/server.js:364:20) at Server._loadPlatforms (/usr/local/lib/node_modules/homebridge/lib/server.js:308:16) at Server.run (/usr/local/lib/node_modules/homebridge/lib/server.js:85:36) at module.exports (/usr/local/lib/node_modules/homebridge/lib/cli.js:40:10) at Object. (/usr/local/lib/node_modules/homebridge/bin/homebridge:17:22) at Module._compile (module.js:660:30) at Object.Module._extensions..js (module.js:671:10) at Module.load (module.js:573:32)

Dengor1984 commented 6 years ago

Такая же проблема... I have the same problem...

h3roin commented 6 years ago

Можно поправить удалив плагин miio и установив miio@0.14.2. но все же было бы неплохо обновить этот плагин так как теперь можно поменять класс устройства с вентилятора на увлажнитель.

You can fix it remove plugin "miio" and setup older version miio@0.14.2. But anyway it a good idea update current plugin for change a device class from fan to humidifier.

Dengor1984 commented 6 years ago

Обновил командой: sudo npm install -g homebridge-miio Получил - homebridge-miio@0.3.2 Результат тот же...

Sorry, but it does't help for me...

h3roin commented 6 years ago

sudo npm remove miio sudo npm install -g miio@0.14.2

Dengor1984 commented 6 years ago

А как правильнее обновить miio чтоб поменять вентилятор на увлажнитель?

h3roin commented 6 years ago

Тут уже вопрос к тому кто написал плагин для увлажнителя / класс в homebridge и miio уже есть

h3roin commented 6 years ago

https://github.com/KhaosT/HAP-NodeJS/blob/master/lib/gen/HomeKitTypes.js#L2854-L2901

Dengor1984 commented 6 years ago

pi@pi:~ $ sudo npm install -g miio@0.14.2 npm ERR! code ETARGET npm ERR! notarget No matching version found for miio@0.14.2 npm ERR! notarget In most cases you or one of your dependencies are requesting npm ERR! notarget a package version that doesn't exist.

npm ERR! A complete log of this run can be found in:npm ERR! /root/.npm/_logs/2018-01-29T08_37_18_667Z-debug.log

h3roin commented 6 years ago

try 0.14.1

Dengor1984 commented 6 years ago

Thank you for a quick reply, miio 0.14.1 helps!)

fenway062213 commented 6 years ago

Is anyone able to get the new update running and able to use the humidifier as a humidifier service? I had to go back to 0.14.1 because I got the error above when I tried updating, but would much prefer the device to be displayed as a humidifier...any help is appreciated.

leoneleone commented 6 years ago

@fenway062213 https://github.com/acc-ua/homebridge-xiaomi-humidifier/pull/11

acc-ua commented 6 years ago

Had merged @fenway062213 commit to fix that problem. Thanks

leoneleone commented 6 years ago

Problems with miio handshake after updating the plugin to work with miio 0.15.6 This plugin intialises but produces an error with connecting to the device.

If someone can confirm this behaviour after updating this plugin I’ll endevour to fix it. If not, I’ll just assume this is specific to my xiaomi device.

maximusnikulin commented 6 years ago

@leoneleone I confirm, that there is a problem with connection to device