Closed jannylund closed 8 years ago
Hi,
@rudders Wants this repo to remain just for plain HTTP commands and not add any plugins.
I will leave this open in case he comes and wants to add it but for the moment this request is rejected.
Fair enough. As I would prefer to have a separate dependency, I could instead refactor it to support a generic json status configuration. Then it would be generic and useful in more cases than my example.
This PR adds support for using a ESP8266 running ESP Easy as http device. The necessary configuration for the accessory is:
"off_url": "http://<ip>/control?cmd=GPIO,<gpio-id>,0", "on_url": "http://<ip>/control?cmd=GPIO,<gpio-id>,1", "status_url": "http://<ip>/control?cmd=status,GPIO,<gpio-id>",
The return value for a status request is json data where the member state contains the actual state of the switch:
{ "log": "", "plugin": 1, "pin": <gpio-id>, "mode": "output", "state": 0 }