alexryd / node-shellies

Handles communication with Shelly devices
MIT License
35 stars 13 forks source link

Prepare library for Shelly unicast support #21

Closed jghaanstra closed 3 years ago

jghaanstra commented 3 years ago

This PR updates the node-shellies library to support unicast for Shelly devices. Unfortunately the node-coap library contains code which prevents this from working correctly. Unicast Shelly devices send requests with the 2.05 content request code which get dropped here: https://github.com/mcollina/node-coap/blob/7a4b770f7fd92f389b7bde3d1c57b6d1822882b0/lib/server.js#L300

Updating this line to if (packet.code[0] !== '0' && packet.code !== '2.05') { and using this changes in this PR will ensure that unicast is supported.

alexryd commented 3 years ago

See #22

jghaanstra commented 3 years ago

Closed because of https://github.com/alexryd/node-shellies/pull/22