Open hogthrob opened 2 years ago
I just wanted to say thanks for the fix but also ask if the root cause was really that the led control methods have been removed in zigbee-herdsman. As far as I could see these were removed with zigbee-herdsman 0.13.170. In the dependencies part in package.json of node-red-contrib-zigbee only contains version 0.13.130. "zigbee-herdsman": "^0.13.130","
^0.13.130 means to use the newest version which is 0.13.130 or higher, but below 0.14, i.e. the newest 0.13.xxx version. You can see this by yourself here: https://semver.npmjs.com/ Just enter zigbee-herdsman and ^0.13.130
Thanks for clarifying. I knew semver with major, minor, patch versions but missed the meaning of the prefix in context of node.
JFYI this PR works fine. @hobbyquaker merge it please.
We just check for the existence of the supportsLED method and only then run the code which used to work in older zigbee-herdsman versions. In case of problems in connect we now properly stop the zigbee adapter before trying to restart it. This was a problem uncovered by #160 but not the root cause (that was the call to a no-longer-existing method of zigbee-herdsman).