Implemented hostname and group check

This commit is contained in:
Kevin Veen-Birkenbach 2020-05-12 11:22:30 +02:00
parent 8527865b9f
commit e2a19fdc76
2 changed files with 5 additions and 4 deletions

View File

@ -5,7 +5,7 @@ String homepage_template(void){
"<html>"
"<head>"
"<meta charset=\"UTF-8\">"
"<title>"+String(titel)+"</title>"
"<title>"+String(titel)+"("+ String(hostname) +")</title>"
"<link rel=\"stylesheet\" href=\"https://maxcdn.bootstrapcdn.com/bootstrap/3.4.1/css/bootstrap.min.css\">"
"<script src=\"https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js\"></script>"
"<script src=\"https://maxcdn.bootstrapcdn.com/bootstrap/3.4.1/js/bootstrap.min.js\"></script>"

View File

@ -125,9 +125,9 @@ void controller(void){
setIrColor(static_cast<decode_type_t>(server.arg(parameter_ir_type).toInt()),server.arg(parameter_ir_data).toInt(),server.arg(parameter_ir_bits).toInt());
}
if(isParameterDefined(parameter_plug_id) && isParameterDefined(parameter_plug_status)){
if(server.arg(parameter_plug_id)=="0"){
if(server.arg(parameter_plug_id)=="group"){
setRitterGroup(server.arg(parameter_plug_status).toInt());
}else{
}else if(server.arg(parameter_plug_id).toInt()>0){
setRitterSwitch(server.arg(parameter_plug_id).toInt(),server.arg(parameter_plug_status).toInt());
}
}
@ -195,7 +195,8 @@ void setup(void)
delay(500);
}
Serial.println("Connected to :" + String(ssid));
Serial.println("IP address: " + WiFi.localIP());
Serial.print("IP address: ");
Serial.println(WiFi.localIP());
if (mdns.begin(hostname, WiFi.localIP())) {
Serial.println("MDNS responder started.");
}