fjhorrillo / homebridge-airzone-cloud

Homebridge Airzone Cloud
Apache License 2.0
22 stars 3 forks source link

Homebridge does not start since 0.1.3 #11

Closed matnoublanche closed 3 years ago

matnoublanche commented 3 years ago

Describe The Bug: Hi there,

Since 0.1.3 I have this error below.

Do you know why ?

Logs:

TypeError: Cannot read property 'error' of undefined
at evaluate (/usr/lib/node_modules/homebridge-airzone-cloud/src/interface/config.ts:23:18)
at Object.isValid (/usr/lib/node_modules/homebridge-airzone-cloud/src/interface/config.ts:38:24)
at new AirzoneCloudHomebridgePlatform (/usr/lib/node_modules/homebridge-airzone-cloud/src/platform.ts:50:36)
at /var/www/html/plugins/homebridge/resources/node_modules/homebridge/src/server.ts:440:40
at Array.forEach (<anonymous>)
at Server.loadPlatforms (/var/www/html/plugins/homebridge/resources/node_modules/homebridge/src/server.ts:372:27)
at Server.start (/var/www/html/plugins/homebridge/resources/node_modules/homebridge/src/server.ts:159:29)

Environment:

fjhorrillo commented 3 years ago

Hello, this is because the airzone api was changed. I’m working to implement the new api

matnoublanche commented 3 years ago

Hi @fjhorrillo,

No, when I downgrade to 0.1.2 it works again.

I'm still using the old app which the old API.

Since 0.1.3 you changed the log way and it seems like Homebridge does not like it at starting.

fjhorrillo commented 3 years ago

Ok, then you need update to 0.1.4 witch is the last version and correct the problem with logs

matnoublanche commented 3 years ago

The problem is still identical on the 0.1.4 version

fjhorrillo commented 3 years ago

Hello @matnoublanche, maybe it is related to the api upgrade, the 0.1.2 is still working?

matnoublanche commented 3 years ago

Hi @fjhorrillo,

In fact the problem was on the NPM logger module.

It was not installed by default and it's not on the dependencies of the package.json file.

I think I can install it manually but I think that it's better to declare it on the dependencies of the module.

Do you know if other encounters the same problem as me ?

fjhorrillo commented 3 years ago

Hi, with version 0.1.3 I had this problem but in the end I went back to using the standard log by adding a new class to print debug logs as information if the plugin debug option is on. This was added in version 0.1.4. What dependency do you want to add?

matnoublanche commented 3 years ago

Ok I think that you still using Logger on the 0.1.4 version, so no need to install this as dependency.

I think I found the origin of the error.

On the src/interface/config.ts file, lines 23 and 27 you have to prefix your lines with this

this.platform.log.error

fjhorrillo commented 3 years ago

Hi, I found the problem, it was due to the log isn`t initialized yet. Fixed in version 0.1.5