AshMartian / homebridge-carwings

9 stars 9 forks source link

session is not a function #1

Closed suhajdab closed 7 years ago

suhajdab commented 7 years ago

I got super excited about this plugin, unfortunately I haven't been able to make it work yet.

/usr/lib/node_modules/homebridge-carwings/node_modules/carwings/lib/index.js:158
const hvacstatus = session => session('RemoteACRecordsRequest', { RegionCode });
                              ^

TypeError: session is not a function
    at Object.hvacstatus [as hvacStatus] (/usr/lib/node_modules/homebridge-carwings/node_modules/carwings/lib/index.js:158:31)
    at CarwingsAccessory.getHVAC (/usr/lib/node_modules/homebridge-carwings/homebridge-carwings.js:110:12)
    at emitThree (events.js:116:13)
    at Characteristic.On.emit (events.js:197:7)
    at Characteristic.On.Characteristic.getValue (/usr/lib/node_modules/homebridge/node_modules/hap-nodejs/lib/Characteristic.js:120:10)
    at Bridge.<anonymous> (/usr/lib/node_modules/homebridge/node_modules/hap-nodejs/lib/Accessory.js:634:20)
    at Array.forEach (native)
    at Bridge.Accessory._handleGetCharacteristics (/usr/lib/node_modules/homebridge/node_modules/hap-nodejs/lib/Accessory.js:598:8)
    at emitMany (events.js:127:13)
    at HAPServer.emit (events.js:204:7)
AshMartian commented 7 years ago

Just saw the issue, did you get it to work by changing the RegionCode at https://github.com/blandman/carwings/blob/master/src/index.js ?

suhajdab commented 7 years ago

Yes, changing the region code does resolve this... to some extent. Obviously the module should handle failed login somewhat more gracefully. :)