From e2a19fdc76919e4557a497cae5905ad35c3564a1 Mon Sep 17 00:00:00 2001 From: "Kevin Veen-Birkenbach [aka. Frantz]" Date: Tue, 12 May 2020 11:22:30 +0200 Subject: [PATCH] Implemented hostname and group check --- main/homepage_template.h | 2 +- main/main.ino | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/main/homepage_template.h b/main/homepage_template.h index 5b59944..829f541 100644 --- a/main/homepage_template.h +++ b/main/homepage_template.h @@ -5,7 +5,7 @@ String homepage_template(void){ "" "" "" - ""+String(titel)+"" + ""+String(titel)+"("+ String(hostname) +")" "" "" "" diff --git a/main/main.ino b/main/main.ino index 539acd5..669ac52 100644 --- a/main/main.ino +++ b/main/main.ino @@ -125,9 +125,9 @@ void controller(void){ setIrColor(static_cast(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."); }