seikan / homebridge-mi-air-purifier

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

Crash with the 1.3.0 version #51

Closed robinfdx closed 6 years ago

robinfdx commented 6 years ago

Hello,

I have new issue with the latest version, so i have this trace 5 second after homebridge start :

(node:2789) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'call' of null
    at MiAirPurifier.getRotationSpeed (/usr/lib/node_modules/homebridge-mi-air-purifier/index.js:291:27)
    at emitThree (events.js:136:13)
    at Characteristic.RotationSpeed.emit (events.js:217:7)
    at Characteristic.RotationSpeed.Characteristic.getValue (/usr/lib/node_modules/homebridge/node_modules/hap-nodejs/lib/Characteristic.js:163:10)
    at Bridge.<anonymous> (/usr/lib/node_modules/homebridge/node_modules/hap-nodejs/lib/Accessory.js:760:20)
    at Array.forEach (<anonymous>)
    at Bridge.Accessory._handleGetCharacteristics (/usr/lib/node_modules/homebridge/node_modules/hap-nodejs/lib/Accessory.js:724:8)
    at emitMany (events.js:147:13)
    at HAPServer.emit (events.js:224:7)
    at HAPServer._handleCharacteristics (/usr/lib/node_modules/homebridge/node_modules/hap-nodejs/lib/HAPServer.js:926:10)
(node:2789) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:2789) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
(node:2789) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'call' of null
    at MiAirPurifier.getLockPhysicalControls (/usr/lib/node_modules/homebridge-mi-air-purifier/index.js:272:27)
    at emitThree (events.js:136:13)
    at Characteristic.LockPhysicalControls.emit (events.js:217:7)
    at Characteristic.LockPhysicalControls.Characteristic.getValue (/usr/lib/node_modules/homebridge/node_modules/hap-nodejs/lib/Characteristic.js:163:10)
    at Bridge.<anonymous> (/usr/lib/node_modules/homebridge/node_modules/hap-nodejs/lib/Accessory.js:760:20)
    at Array.forEach (<anonymous>)
    at Bridge.Accessory._handleGetCharacteristics (/usr/lib/node_modules/homebridge/node_modules/hap-nodejs/lib/Accessory.js:724:8)
    at emitMany (events.js:147:13)
    at HAPServer.emit (events.js:224:7)
    at HAPServer._handleCharacteristics (/usr/lib/node_modules/homebridge/node_modules/hap-nodejs/lib/HAPServer.js:926:10)
(node:2789) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 2)

Can you help me ?

homebridge-mi-air-purifier@1.3.0 miio@0.15.6 homebridge@0.4.42

My config file :

{
    "bridge": {
        "name": "Homebridge",
        "username": "XXXXX",
        "port": XXXX,
        "pin": "XXXX"
    },
    "description": "This is an example configuration file with one fake accessory and one fake platform. You can use this as a template for creating your own configuration file containing devices you actually own.",
    "accessories": [
        {
            "accessory": "MiAirPurifier",
            "name": "Air Purifier",
            "ip": "XXXX",
            "token": "XXXX",
            "showTemperature": true,
            "showHumidity": true,
            "showAirQuality": true
        }
    ],
    "platforms": [
        {
            "platform": "DysonPlatform",
            "name": "DysonPlatform",
            "accessories": [
                {
                    "ip": "XXX",
                    "displayName": "Dyson",
                    "serialNumber": "XXXX",
                    "password": "XXX"
                }
            ]
        }
    ]
}
seikan commented 6 years ago

It seems like the command has been executed before the air purifier is being discovered.

I released 1.3.1 to resolve this.

robinfdx commented 6 years ago

Thanks a lot for your upgrade, it's work like a charm now :-).

Thanks again