Closed jghaanstra closed 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.
if (packet.code[0] !== '0' && packet.code !== '2.05') {
See #22
Closed because of https://github.com/alexryd/node-shellies/pull/22
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.