Skip to content

Instantly share code, notes, and snippets.

@sidoh
Created May 24, 2018 20:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sidoh/605bac2ca01e9a13b9f8a9df2a9c27c0 to your computer and use it in GitHub Desktop.
Save sidoh/605bac2ca01e9a13b9f8a9df2a9c27c0 to your computer and use it in GitHub Desktop.
$ curl http://10.133.8.158/gateways/1234/rgbw/\{1,2,3,4\}
[1/4]: http://10.133.8.158/gateways/1234/rgbw/1 --> <stdout>
--_curl_--http://10.133.8.158/gateways/1234/rgbw/1
{"color":{"r":255,"g":255,"b":255}}
[2/4]: http://10.133.8.158/gateways/1234/rgbw/2 --> <stdout>
--_curl_--http://10.133.8.158/gateways/1234/rgbw/2
{"color":{"r":255,"g":255,"b":255}}
[3/4]: http://10.133.8.158/gateways/1234/rgbw/3 --> <stdout>
--_curl_--http://10.133.8.158/gateways/1234/rgbw/3
{"color":{"r":255,"g":255,"b":255}}
[4/4]: http://10.133.8.158/gateways/1234/rgbw/4 --> <stdout>
--_curl_--http://10.133.8.158/gateways/1234/rgbw/4
{"color":{"r":255,"g":255,"b":255}}%
$ curl -X PUT -H 'Content-Type: application/json' -d '{"state":"on"}' http://10.133.8.158/gateways/1234/rgbw/1
{"state":"ON","color":{"r":255,"g":255,"b":255}}%
$ curl http://10.133.8.158/gateways/1234/rgbw/\{1,2,3,4\}
[1/4]: http://10.133.8.158/gateways/1234/rgbw/1 --> <stdout>
--_curl_--http://10.133.8.158/gateways/1234/rgbw/1
{"state":"ON","color":{"r":255,"g":255,"b":255}}
[2/4]: http://10.133.8.158/gateways/1234/rgbw/2 --> <stdout>
--_curl_--http://10.133.8.158/gateways/1234/rgbw/2
{"color":{"r":255,"g":255,"b":255}}
[3/4]: http://10.133.8.158/gateways/1234/rgbw/3 --> <stdout>
--_curl_--http://10.133.8.158/gateways/1234/rgbw/3
{"color":{"r":255,"g":255,"b":255}}
[4/4]: http://10.133.8.158/gateways/1234/rgbw/4 --> <stdout>
--_curl_--http://10.133.8.158/gateways/1234/rgbw/4
{"color":{"r":255,"g":255,"b":255}}%
$ curl -X PUT -H 'Content-Type: application/json' -d '{"state":"on"}' http://10.133.8.158/gateways/1234/rgbw/0
{"state":"ON","color":{"r":255,"g":255,"b":255}}%
$ curl http://10.133.8.158/gateways/1234/rgbw/\{1,2,3,4\}
[1/4]: http://10.133.8.158/gateways/1234/rgbw/1 --> <stdout>
--_curl_--http://10.133.8.158/gateways/1234/rgbw/1
{"state":"ON","color":{"r":255,"g":255,"b":255}}
[2/4]: http://10.133.8.158/gateways/1234/rgbw/2 --> <stdout>
--_curl_--http://10.133.8.158/gateways/1234/rgbw/2
{"state":"ON","color":{"r":255,"g":255,"b":255}}
[3/4]: http://10.133.8.158/gateways/1234/rgbw/3 --> <stdout>
--_curl_--http://10.133.8.158/gateways/1234/rgbw/3
{"state":"ON","color":{"r":255,"g":255,"b":255}}
[4/4]: http://10.133.8.158/gateways/1234/rgbw/4 --> <stdout>
--_curl_--http://10.133.8.158/gateways/1234/rgbw/4
{"state":"ON","color":{"r":255,"g":255,"b":255}}%
$ curl -X PUT -H 'Content-Type: application/json' -d '{"state":"off"}' http://10.133.8.158/gateways/1234/rgbw/3
{"state":"OFF","color":{"r":255,"g":255,"b":255}}%
$ curl http://10.133.8.158/gateways/1234/rgbw/\{1,2,3,4\}
[1/4]: http://10.133.8.158/gateways/1234/rgbw/1 --> <stdout>
--_curl_--http://10.133.8.158/gateways/1234/rgbw/1
{"state":"ON","color":{"r":255,"g":255,"b":255}}
[2/4]: http://10.133.8.158/gateways/1234/rgbw/2 --> <stdout>
--_curl_--http://10.133.8.158/gateways/1234/rgbw/2
{"state":"ON","color":{"r":255,"g":255,"b":255}}
[3/4]: http://10.133.8.158/gateways/1234/rgbw/3 --> <stdout>
--_curl_--http://10.133.8.158/gateways/1234/rgbw/3
{"state":"OFF","color":{"r":255,"g":255,"b":255}}
[4/4]: http://10.133.8.158/gateways/1234/rgbw/4 --> <stdout>
--_curl_--http://10.133.8.158/gateways/1234/rgbw/4
{"state":"ON","color":{"r":255,"g":255,"b":255}}%
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment