seikan / homebridge-mi-air-purifier

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

index.js:152 crash #46

Closed leavez closed 6 years ago

leavez commented 6 years ago
/opt/nodejs/lib/node_modules/homebridge-mi-air-purifier/index.js:152
        this.device.call('get_prop', ['mode'])
                    ^

TypeError: Cannot read property 'call' of undefined
    at MiAirPurifier.getTargetAirPurifierState (/opt/nodejs/lib/node_modules/homebridge-mi-air-purifier/index.js:152:15)
    at emitThree (events.js:136:13)
    at Characteristic.TargetAirPurifierState.emit (events.js:217:7)
    at Characteristic.TargetAirPurifierState.Characteristic.getValue (/opt/nodejs/lib/node_modules/homebridge/node_modules/hap-nodejs/lib/Characteristic.js:162:10)
    at Bridge.<anonymous> (/opt/nodejs/lib/node_modules/homebridge/node_modules/hap-nodejs/lib/Accessory.js:756:20)
    at Array.forEach (<anonymous>)
    at Bridge.Accessory._handleGetCharacteristics (/opt/nodejs/lib/node_modules/homebridge/node_modules/hap-nodejs/lib/Accessory.js:720:8)
    at emitMany (events.js:147:13)
    at HAPServer.emit (events.js:224:7)
    at HAPServer._handleCharacteristics (/opt/nodejs/lib/node_modules/homebridge/node_modules/hap-nodejs/lib/HAPServer.js:926:10)
leavez commented 6 years ago

another crash

/opt/nodejs/lib/node_modules/homebridge-mi-air-purifier/index.js:133
        this.device.call('set_power', [(state) ? 'on' : 'off'])
                    ^

TypeError: Cannot read property 'call' of undefined
    at MiAirPurifier.setActive (/opt/nodejs/lib/node_modules/homebridge-mi-air-purifier/index.js:133:15)
    at emitMany (events.js:147:13)
    at Characteristic.Active.emit (events.js:224:7)
    at Characteristic.Active.Characteristic.setValue (/opt/nodejs/lib/node_modules/homebridge/node_modules/hap-nodejs/lib/Characteristic.js:319:10)
    at Bridge.<anonymous> (/opt/nodejs/lib/node_modules/homebridge/node_modules/hap-nodejs/lib/Accessory.js:867:22)
    at Array.forEach (<anonymous>)
    at Bridge.Accessory._handleSetCharacteristics (/opt/nodejs/lib/node_modules/homebridge/node_modules/hap-nodejs/lib/Accessory.js:807:8)
    at emitMany (events.js:147:13)
    at HAPServer.emit (events.js:224:7)
    at HAPServer._handleCharacteristics (/opt/nodejs/lib/node_modules/homebridge/node_modules/hap-nodejs/lib/HAPServer.js:972:10)
seikan commented 6 years ago

Please use the following command to install a correct version of miio.

npm install -g miio@0.14.1