seikan / homebridge-mi-air-purifier

A Xiaomi Mi air purifier plugin for Homebridge.
Other
172 stars 65 forks source link

TypeError: miio.createDevice is not a function #31

Closed jerryngm closed 6 years ago

jerryngm commented 6 years ago

Hi I'm having this error when running, please assist:

[2018-1-25 13:54:59] [Air Purifier] Initializing XiaoMiAirPurifier accessory... /usr/lib/node_modules/homebridge-xiaomi-air-purifier/index.js:106 var device = miio.createDevice({ ^

TypeError: miio.createDevice is not a function at XiaoMiAirPurifier.discover (/usr/lib/node_modules/homebridge-xiaomi-air-purifier/index.js:106:27) at new XiaoMiAirPurifier (/usr/lib/node_modules/homebridge-xiaomi-air-purifier/index.js:99:10) at Server._loadAccessories (/usr/lib/node_modules/homebridge/lib/server.js:275:29) at Server.run (/usr/lib/node_modules/homebridge/lib/server.js:86:38) at module.exports (/usr/lib/node_modules/homebridge/lib/cli.js:40:10) at Object. (/usr/lib/node_modules/homebridge/bin/homebridge:17:22) at Module._compile (module.js:643:30) at Object.Module._extensions..js (module.js:654:10) at Module.load (module.js:556:32) at tryModuleLoad (module.js:499:12)

Thank you

shexbeer commented 6 years ago

Miio developers did major changes in their API. This changes arent't reflected in current plugin. So you need to install the old miio version:

npm install -g miio@0.14.1

FradSer commented 6 years ago

npm install -g miio@0.14.1 works for me.