Skip to content

Commit

Permalink
add dsicover end-point fix #209
Browse files Browse the repository at this point in the history
  • Loading branch information
glynhudson committed Jan 24, 2019
1 parent 012d6c8 commit dd4de35
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 8 deletions.
2 changes: 1 addition & 1 deletion platformio.ini
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ data_dir = src/data
env_default = openevse

[common]
version = -DBUILD_TAG=2.7.7
version = -DBUILD_TAG=2.7.8
monitor_speed=115200
lib_deps = [email protected], ESP Async [email protected], [email protected]
extra_scripts = scripts/extra_script.py
Expand Down
2 changes: 1 addition & 1 deletion src/data/home.htm

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/data/style.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 14 additions & 3 deletions src/web_server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -634,6 +634,7 @@ handleRst(AsyncWebServerRequest *request) {
systemRebootTime = millis() + 1000;
}


// -------------------------------------------------------------------
// Restart (Reboot)
// url: /restart
Expand All @@ -652,6 +653,18 @@ handleRestart(AsyncWebServerRequest *request) {
systemRestartTime = millis() + 1000;
}


// -------------------------------------------------------------------
// Emoncms describe end point,
// Allows local device discover using https://github.com/emoncms/find
// url: //emoncms/describe
// -------------------------------------------------------------------
void handleDescribe(AsyncWebServerRequest *request) {
AsyncWebServerResponse *response = request->beginResponse(200, CONTENT_TYPE_TEXT, "openevse");
response->addHeader("Access-Control-Allow-Origin", "*");
request->send(response);
}

// -------------------------------------------------------------------
// Update firmware
// url: /update
Expand Down Expand Up @@ -922,16 +935,14 @@ web_server_setup() {
server.on("/savemqtt", handleSaveMqtt);
server.on("/saveadmin", handleSaveAdmin);
server.on("/saveohmkey", handleSaveOhmkey);

server.on("/reset", handleRst);
server.on("/restart", handleRestart);

server.on("/rapi", handleRapi);
server.on("/r", handleRapi);

server.on("/scan", handleScan);
server.on("/apoff", handleAPOff);
server.on("/divertmode", handleDivertMode);
server.on("/emoncms/describe", handleDescribe);

// Simple Firmware Update Form
server.on("/update", HTTP_GET, handleUpdateGet);
Expand Down
2 changes: 1 addition & 1 deletion src/web_server.home.htm.h

Large diffs are not rendered by default.

Loading

0 comments on commit dd4de35

Please sign in to comment.