lasthead0 / ioBroker.xiaomi-gateway3

Adapter for Xiaomi Gateway 3 integration
MIT License
6 stars 4 forks source link

Problems parsing load_avg from gateway #10

Closed Homemade-Disaster closed 2 years ago

Homemade-Disaster commented 2 years ago

Hello,

since 0.3.4 you get following error during parsing the gateway. It seems, that the load_avg is not available every time.

TypeError: Cannot read property 'split' of undefined at /opt/iobroker/node_modules/iobroker.xiaomi-gateway3/lib/lumi.js:950:43 at /opt/iobroker/node_modules/iobroker.xiaomi-gateway3/lib/lumi.js:746:90 at Array.reduce () at /opt/iobroker/node_modules/iobroker.xiaomi-gateway3/lib/lumi.js:746:72 at LumiStateClass.normalizeLeft (/opt/iobroker/node_modules/iobroker.xiaomi-gateway3/lib/lumi.js:747:82) at LumiStateClass.decode (/opt/iobroker/node_modules/iobroker.xiaomi-gateway3/lib/lumi.js:769:63) at /opt/iobroker/node_modules/iobroker.xiaomi-gateway3/lib/gateway3.js:577:68 at Array.reduce () at Gateway3.processMessageLumi (/opt/iobroker/node_modules/iobroker.xiaomi-gateway3/lib/gateway3.js:577:14) at XiaomiGateway3._onMqttMessage (/opt/iobroker/node_modules/iobroker.xiaomi-gateway3/main.js:363:31)

kind regards

lasthead0 commented 2 years ago

Hi.

This is strange, but all seems like you write and load_avg not always in message. I did fixes to master.

Homemade-Disaster commented 2 years ago

Hi,

thanks, I try to test your solution right now. At the moment it seems ok but I'll give you feedback tomorrow.

kr

Homemade-Disaster commented 2 years ago

Hello, it seems to be ok. Did not get the error anymore.

kr