Doorbell Speaker status

This commit is contained in:
2021-09-15 09:26:09 +02:00
parent faa657cc04
commit 0a9ea7eebb
+17 -7
View File
@@ -102,7 +102,17 @@ void loop() {
// if the current line is blank, you got two newline characters in a row. // if the current line is blank, you got two newline characters in a row.
// that's the end of the client HTTP request, so send a response: // that's the end of the client HTTP request, so send a response:
if (currentLine.length() == 0) { if (currentLine.length() == 0) {
if (header.indexOf("GET /volume") >= 0) { if (header.indexOf("GET /status") >= 0) {
client.println("HTTP/1.1 200 OK");
client.println("Content-type: application/json; charset=utf-8");
client.println("Connection: close");
client.println();
client.println("{");
client.println(" \"status\": true");
client.println("}");
break;
}
else if (header.indexOf("GET /volume") >= 0) {
client.println("HTTP/1.1 200 OK"); client.println("HTTP/1.1 200 OK");
client.println("Content-type: application/json; charset=utf-8"); client.println("Content-type: application/json; charset=utf-8");
client.println("Connection: close"); client.println("Connection: close");
@@ -236,22 +246,22 @@ void loop() {
String printDetail(uint8_t type, int value){ String printDetail(uint8_t type, int value){
switch (type) { switch (type) {
case TimeOut: case TimeOut:
return "Time Out!"; return "Time Out";
break; break;
case WrongStack: case WrongStack:
return "Stack Wrong!"; return "Stack Wrong";
break; break;
case DFPlayerCardInserted: case DFPlayerCardInserted:
return "Card Inserted!"; return "Card Inserted";
break; break;
case DFPlayerCardRemoved: case DFPlayerCardRemoved:
return "Card Removed!"; return "Card Removed";
break; break;
case DFPlayerCardOnline: case DFPlayerCardOnline:
return "Card Online!"; return "Card Online";
break; break;
case DFPlayerPlayFinished: case DFPlayerPlayFinished:
return "Play Finished!"; return "Play Finished";
break; break;
case DFPlayerError: case DFPlayerError:
switch (value) { switch (value) {