ondrej1024 / crelay

Controlling different relay cards for home automation with a Linux software
GNU General Public License v2.0
80 stars 31 forks source link

Add support for multiple relay cards in the http api interface #27

Closed derekatkins closed 6 years ago

derekatkins commented 6 years ago

I tested that I could both read and write to different (sainsmart16) cards. It still defaults to the "first" card if you don't supply the 'serial' parameter. Note that I only tested with GET, not POST. Oh, I also fixed a potential security issue (buffer overflow) in reading the parameters.

ondrej1024 commented 6 years ago

I just merged this. Works great, Thank you.

It would probably be a good idea to add an option/parameter to the API to request the list of all serial numbers connected to the system (like the -i command line switch)

derekatkins commented 6 years ago

It would probably be a good idea to add an option/parameter to the API to request the list of all serial numbers connected to the system (like the -icommand line switch)

Yeah, I was thinking that as well, but it was more work at the time. I'll look into it for a future PR (but it's not really a feature I need myself)