From 3cbdf20e7999433031c939a6c00e9a6c84850f2e Mon Sep 17 00:00:00 2001 From: Kai Lauterbach Date: Tue, 2 May 2023 08:03:14 +0200 Subject: [PATCH] Fixed replacement of some placeholder. Added a timezone string to the config. --- firmware/config.h | 4 +++- firmware/config_html.h | 8 ++++---- firmware/config_html.html | 8 ++++---- firmware/firmware.ino | 29 +++++++++++++++++------------ firmware/index_html.h | 7 +++---- firmware/index_html.html | 8 ++++---- firmware/timing_control.ino | 2 +- 7 files changed, 36 insertions(+), 30 deletions(-) diff --git a/firmware/config.h b/firmware/config.h index 5c33146..6b84c6c 100644 --- a/firmware/config.h +++ b/firmware/config.h @@ -2,8 +2,10 @@ #define USE_STATIC_IP //! uncomment to enable Static IP Adress #define SERIAL_BAUD_RATE 115200 + +#define LOCAL_TIMEZONE_STRING "CET-1CEST-2,M3.5.0/02:00:00,M10.5.0/03:00:00" // Berlin, Germany - https://sites.google.com/a/usapiens.com/opnode/time-zones -#define light_name "Dimmable Hue Light" //default light name +#define light_name "Dimmable Hue Light (DEV)" // default light name #define LIGHTS_COUNT 4 // do not modify because luminie p30 only has 4 channel, never set above 80 diff --git a/firmware/config_html.h b/firmware/config_html.h index b58691c..482f6b1 100644 --- a/firmware/config_html.h +++ b/firmware/config_html.h @@ -45,19 +45,19 @@ String getConfigHTML() "" "
" "" -"" +"" "
" "
" "" -"" +"" "
" "
" "" -"" +"" "
" "
" "" -"" +"" "
" "
" "" diff --git a/firmware/config_html.html b/firmware/config_html.html index b921a0a..f96ff61 100644 --- a/firmware/config_html.html +++ b/firmware/config_html.html @@ -41,19 +41,19 @@
- +
- +
- +
- +
diff --git a/firmware/firmware.ino b/firmware/firmware.ino index 50b0173..257fd27 100644 --- a/firmware/firmware.ino +++ b/firmware/firmware.ino @@ -80,12 +80,16 @@ uint32_t last_lightengine_activity = 0; //********************************// -void apply_scene(uint8_t new_scene, uint8_t light) { - if (new_scene == SCENE_RELEAX) { +void apply_scene(uint8_t new_scene, uint8_t light) +{ + if (new_scene == SCENE_RELEAX) + { bri[light] = 144; - } else if (new_scene == SCENE_BRIGHT) { + } else if (new_scene == SCENE_BRIGHT) + { bri[light] = 254; - } else if (new_scene == SCENE_NIGHTLY) { + } else if (new_scene == SCENE_NIGHTLY) + { bri[0] = 25; bri[1] = 0; bri[2] = 0; @@ -619,6 +623,8 @@ void init_webserver() http_content.replace("{{LIGHT_NAME}}", (String)light_name); + http_content.replace("{{LIGHT_COUNT}}", (String)LIGHTS_COUNT); + int tc_val = EEPROM.read(EEPROM_TIMING_CONTROL_ENABLED_ADDRESS); if (tc_val == TIMING_CONTROL_ENABLED) { @@ -700,7 +706,7 @@ void init_webserver() String config_content = getConfigHTML(); // Wifi settings - config_content.replace("{{WIFI_SSIF}}", WiFi.SSID()); + config_content.replace("{{WIFI_SSID}}", WiFi.SSID()); // Network settings uint8_t dip = EEPROM.read(EEPROM_DYNAMIC_IP_ADDRESS); @@ -714,16 +720,15 @@ void init_webserver() } // ip config - if (dip == 0) - { - config_content.replace("{{WIFI_IP}}", WiFi.localIP().toString()); - config_content.replace("{{WIFI_GW}}", WiFi.gatewayIP().toString()); - config_content.replace("{{WIFI_NM}}", WiFi.subnetMask().toString()); - config_content.replace("{{WIFI_DNS}}", WiFi.dnsIP().toString()); - } + config_content.replace("{{WIFI_CFG_IP}}", WiFi.localIP().toString()); + config_content.replace("{{WIFI_CFG_GW}}", WiFi.gatewayIP().toString()); + config_content.replace("{{WIFI_CFG_NM}}", WiFi.subnetMask().toString()); + config_content.replace("{{WIFI_CFG_DNS}}", WiFi.dnsIP().toString()); http_content.replace("{{CONFIG_PAGE}}", config_content); + http_content.replace("{{IP_ADDRESS}}", WiFi.localIP().toString()); + // set the pwm values http_content.replace("{{PWM_MIN}}", (String)PWM_MIN); http_content.replace("{{PWM_MAX}}", (String)PWM_MAX); diff --git a/firmware/index_html.h b/firmware/index_html.h index 13769b5..14daf5e 100644 --- a/firmware/index_html.h +++ b/firmware/index_html.h @@ -36,7 +36,7 @@ String getIndexHTML() "Timing control" "" "ON" -"OFF" +"OFF" "
" "