summaryrefslogtreecommitdiff
path: root/HouseControl.ino
diff options
context:
space:
mode:
Diffstat (limited to 'HouseControl.ino')
-rw-r--r--HouseControl.ino34
1 files changed, 34 insertions, 0 deletions
diff --git a/HouseControl.ino b/HouseControl.ino
index 622ce3d..e8b0841 100644
--- a/HouseControl.ino
+++ b/HouseControl.ino
@@ -302,6 +302,35 @@ void doHandler(WebServer &server, WebServer::ConnectionType type, char *url_tail
}
+void configHandler(WebServer &server, WebServer::ConnectionType type, char *url_tail, bool tail_complete) {
+ /* for a GET or HEAD, send the standard "it's all OK headers" */
+ server.httpSuccess("text/html");
+
+ /* we don't output the body for a HEAD request */
+ if (type == WebServer::GET) {
+ }
+}
+
+void configGetHandler(WebServer &server, WebServer::ConnectionType type, char *url_tail, bool tail_complete) {
+ /* for a GET or HEAD, send the standard "it's all OK headers" */
+ server.httpSuccess("text/plain");
+
+ /* we don't output the body for a HEAD request */
+ if (type == WebServer::GET) {
+ }
+}
+
+void configSetHandler(WebServer &server, WebServer::ConnectionType type, char *url_tail, bool tail_complete) {
+ if (type == WebServer::POST) {
+ server.httpSuccess();
+ server.write("OK");
+ return;
+ }
+
+ server.httpSeeOther("/");
+ return;
+}
+
/*********************************************************************************/
/* Miscellaneous functions */
@@ -373,6 +402,11 @@ void setup() {
httpServer.setDefaultCommand(&httpHandler);
httpServer.addCommand("json", &jsonHandler);
httpServer.addCommand("do", &doHandler);
+
+ httpServer.addCommand("config", &configHandler);
+ httpServer.addCommand("config/get", &configGetHandler);
+ httpServer.addCommand("config/set", &configSetHandler);
+
httpServer.begin();
setupDoor(&frontDoor, FDOOR_STRIKE, FDOOR_CLOSED, 255);