ecoen66 / homebridge-solaredge-inverter

SolarEdge Inverter plugin for homebridge
MIT License
14 stars 8 forks source link

TypeError: Cannot read property '0' of undefined #9

Closed jlaska closed 3 years ago

jlaska commented 3 years ago

Hello! Thanks for the plugin. When updating to the latest, I receive the following exception on startup. Rolling back to 0.0.4 seems to work for me.

[11/5/2020, 6:18:02 PM] ---
[11/5/2020, 6:18:02 PM] Loaded plugin: homebridge-solaredge-inverter@0.1.3
[11/5/2020, 6:18:02 PM] Registering accessory 'homebridge-solaredge-inverter.SolarEdge Inverter'
[11/5/2020, 6:18:02 PM] ---
[11/5/2020, 6:18:02 PM] [SolarEdge Inverter] Initializing SolarEdge Inverter accessory...
[11/5/2020, 6:18:02 PM] TypeError: Cannot read property '0' of undefined
    at new SolarEdgeInverter (/homebridge/node_modules/homebridge-solaredge-inverter/index.js:127:37)
    at /usr/local/lib/node_modules/homebridge/src/server.ts:357:50
    at Array.forEach (<anonymous>)
    at Server._loadAccessories (/usr/local/lib/node_modules/homebridge/src/server.ts:330:29)
    at Server.start (/usr/local/lib/node_modules/homebridge/src/server.ts:156:12)
    at cli (/usr/local/lib/node_modules/homebridge/src/cli.ts:80:10)
    at Object.<anonymous> (/usr/local/lib/node_modules/homebridge/bin/homebridge:17:22)
    at Module._compile (internal/modules/cjs/loader.js:1133:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1153:10)
    at Module.load (internal/modules/cjs/loader.js:977:32)
[11/5/2020, 6:18:02 PM] Got SIGTERM, shutting down Homebridge...

My config.json is pretty standard.

        {
            "name": "SolarEdge Inverter",                                                                  
            "manufacturer": "SolarEdge ",
            "site_id": "123456789",
            "api_key": "BLABLABLABLA",
            "accessory": "SolarEdge Inverter"
        }
jakub-symphony commented 3 years ago

Having the same error

ecoen66 commented 3 years ago

I've modified 0.1.4 to be backward compatible with the old config.json schema. That should fix this issue. Please Close with Comment if that is the case.

jlaska commented 3 years ago

@ecoen66 thank you! Version 0.1.4 resolved the reported issue.