wailuen / homebridge-sensibo-sky

Homebridge Sensibo Sky
33 stars 25 forks source link

TypeError: Cannot read property 'temperature' of undefined #15

Open reuvenw opened 7 years ago

reuvenw commented 7 years ago

Thanks for your great work on this awesome project! Just installed Homebridge and your plugin for the first time. Added the configuration (which I'll include below), and then after about a minute or so, Homebridge crashes with this message:

[9/6/2017, 1:44:06 PM] Homebridge is running on port 51826.
/usr/local/lib/node_modules/homebridge-sensibo-sky/accessories/pods.js:503
            that.temp.temperature = data[0].temperature * tempOffset;
                                           ^

TypeError: Cannot read property 'temperature' of undefined
    at /usr/local/lib/node_modules/homebridge-sensibo-sky/accessories/pods.js:503:35
    at /usr/local/lib/node_modules/homebridge-sensibo-sky/lib/sensiboapi.js:127:5
    at IncomingMessage. (/usr/local/lib/node_modules/homebridge-sensibo-sky/lib/sensiboapi.js:50:21)
    at emitNone (events.js:91:20)
    at IncomingMessage.emit (events.js:185:7)
    at endReadableNT (_stream_readable.js:974:12)
    at _combinedTickCallback (internal/process/next_tick.js:80:11)
    at process._tickCallback (internal/process/next_tick.js:104:9)

Am I missing a configuration detail? Or is this a bug?

Config is:

{
        "bridge": {
                "name": "Homebridge",
                "username": "[redacted]",
                "port": 51826,
                "pin": "[redacted]"
        },

        "platforms": [{
                "platform": "SensiboSky",
                "name": "Sensibo",
                "apiKey": "[redacted]",
                "ai": true,
                "hideFan": false,
                "hideHumidity": true,
                "fixedState": "auto"
        }]
}