marcsowen / homebridge-homematicip

Homematic IP plugin for homebridge
Apache License 2.0
77 stars 20 forks source link

Disconnected HMIP-FSM generates warning message #365

Closed smhex closed 2 years ago

smhex commented 2 years ago

It's for sure not a normal use case, however I noticed a warning when my disconnected HMIP-FSM receives some update from the cloud service. In my scenario the HMIP-FSM is triggered by a HMI-SMI55-2. If I switch the HMIP-FSM ON/OFF via Homematic App everything works as expected (except the fact that nothing happens).

[6/18/2022, 9:44:39 PM] [homebridge-homematicip] This plugin generated a warning from the characteristic 'On': characteristic was supplied illegal value: null! Home App will reject null for Apple defined characteristics. See https://homebridge.io/w/JtMGR for more info.
[6/18/2022, 9:44:39 PM] [homebridge-homematicip] Error: 
    at HmIPSwitchMeasuring.handleOnGet (/homebridge/node_modules/.pnpm/homebridge-homematicip@0.8.0/node_modules/homebridge-homematicip/src/devices/HmIPSwitchMeasuring.ts:63:5)

Maybe in this rare case the message response looks different...

I will take a look on it myself. This issue is just for documentation 😀

smhex commented 2 years ago

I could not reproduce this issue hence I will close it.

smhex commented 2 years ago

Found the cause in HmIPSwitchMeasuring.ts:Line 93:

if (switchMeasuringChannel.on !== this.on) {

needs an additional null check

smhex commented 2 years ago

Created PR #390 with bugfix

smhex commented 2 years ago

Hi @marcsowen , is this PR worth to create a 1.0.1 version of the plug-in? Thanks for reviewing it.

marcsowen commented 2 years ago

Thanks! Sure, I will release it tomorrow.

marcsowen commented 2 years ago

Version 1.0.1 with your fix is released

smhex commented 2 years ago

Perfect! Thank you very much!