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.
// that's the end of the client HTTP request, so send a response:
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("Content-type: application/json; charset=utf-8");
client.println("Connection: close");
@@ -236,22 +246,22 @@ void loop() {
String printDetail(uint8_t type, int value){
switch (type) {
case TimeOut:
return "Time Out!";
return "Time Out";
break;
case WrongStack:
return "Stack Wrong!";
return "Stack Wrong";
break;
case DFPlayerCardInserted:
return "Card Inserted!";
return "Card Inserted";
break;
case DFPlayerCardRemoved:
return "Card Removed!";
return "Card Removed";
break;
case DFPlayerCardOnline:
return "Card Online!";
return "Card Online";
break;
case DFPlayerPlayFinished:
return "Play Finished!";
return "Play Finished";
break;
case DFPlayerError:
switch (value) {