caseyjhol / node-red-contrib-tplink

A collection of Node-RED nodes for TP-Link Smart Home devices
https://www.npmjs.com/package/node-red-contrib-tplink-iot
MIT License
17 stars 15 forks source link

Multi-Plug Support - Patch2 #12

Closed MaddyTP closed 4 years ago

MaddyTP commented 4 years ago

Update to support use of "|" in separating events both as string and event property. Also includes "switch" to toggle opposite state supporting past versions.

caseyjhol commented 4 years ago

Maybe add a note about 'switch' being deprecated. I don't think we need two names for the same thing, but I agree we should keep support for now (until v1.0.0).

MaddyTP commented 4 years ago

Maybe add a note about 'switch' being deprecated. I don't think we need two names for the same thing, but I agree we should keep support for now (until v1.0.0).

Great idea.

Out of shear curiosity, is there a reason bulbs and plugs are separated into two nodes? I see a lot of similarity in the code, it probably wouldn't take much to merge the two into a single node handling all TPLink devices.

caseyjhol commented 4 years ago

No reason, really, other than that's the way it was when I forked it. I don't have a bulb, so I've never really looked at the code. I wanted to add support for the HS220 and to turn off the LED so I forked the project and starting merging pull requests. At the very least we could probably keep two separate nodes, but consolidate a lot of the duplicate code and use it with each node.

MaddyTP commented 4 years ago

Gotcha. Might be something to consider for v1.0.0 to simplify management of the resources and code.