";
+ http_content += "
";
+
+ // timing control button
+ http_content += "
";
+ http_content += "
";
+ http_content += "
";
int tc_val = EEPROM.read(EEPROM_TIMING_CONTROL_ENABLED_ADDRESS);
- if (tc_val == TIMING_CONTROL_ENABLED)
- {
- http_content.replace("{{TC_LINK_PRIMARY_ON}}", "pure-button-primary");
- } else {
- http_content.replace("{{TC_LINK_PRIMARY_ON}}", "");
- }
- if (tc_val == TIMING_CONTROL_DISABLED)
- {
- http_content.replace("{{TC_LINK_PRIMARY_OFF}}", "pure-button-primary");
- } else {
- http_content.replace("{{TC_LINK_PRIMARY_OFF}}", "");
- }
+ http_content += "
ON";
+ http_content += "
OFF";
+ http_content += "
";
+ http_content += "";
+ http_content += "
";
- http_content.replace("{{TRANSITION_TIME}}", (String)default_transitiontime);
+ http_content += "
";
+ http_content += "";
+ http_content += "";
+ http_content += "
";
+ http_content += "
";
- String light_content = "";
+ http_content += "";
+
+ http_content += "
";
// Light control
for (uint8 light_num = 0; light_num < LIGHTS_COUNT; light_num++)
{
- // Generate lights part of the HTML page
- String tmp_light_content = light_html;
+ // on/off buttons
+ http_content += "Light " + (String)(light_num + 1) + "";
+ http_content += "";
+ http_content += " ";
+ http_content += " ON";
+ http_content += " OFF";
+ http_content += " ";
- // on/off buttons and slider
- tmp_light_content.replace("{{LIGHT_NUMBER}}", (String)(light_num + 1));
- tmp_light_content.replace("{{LIGHT_NUMBER_DEC}}", (String)light_num);
+ // slider for brightness
+ http_content += "";
+ http_content += "";
+ http_content += "";
+ http_content += " " + (String)(int)(bri[light_num] * 100.0 / 255.0) + "%";
+ http_content += " ";
+ http_content += "";
+ http_content += " %";
+ http_content += "";
+
+ http_content += " ";
- // add the lights code to the html output string
- light_content += tmp_light_content;
}
+ http_content += "";
- // add the created lights control code to the html output
- http_content.replace("{{LIGHTS_CONTROL}}", light_content);
+ http_content += " | ";
+ http_content += "";
+ http_content += " |
";
+ http_content += "
Config
";
+ http_content += "
";
+ http_content += "";
+ http_content += "";
+ http_content += "
";
// scene
+ http_content += "
";
+ http_content += "";
+ http_content += "";
+ http_content += "
";
// Wifi settings
- config_content.replace("{{WIFI_SSIF}}", WiFi.SSID());
+ http_content += "
";
+ http_content += "
Wifi
";
+ http_content += "
";
+ http_content += "";
+ http_content += "";
+ http_content += "
";
+ http_content += "
";
+ http_content += "";
+ http_content += "";
+ http_content += "
";
// Network settings
uint8_t dip = EEPROM.read(EEPROM_DYNAMIC_IP_ADDRESS);
- if (dip)
- {
- config_content.replace("{{DIP_LINK_ON_PRIMARY}}", "pure-button-primary");
- config_content.replace("{{DIP_LINK_OFF_PRIMARY}}", "");
- } else {
- config_content.replace("{{DIP_LINK_OFF_PRIMARY}}", "pure-button-primary");
- config_content.replace("{{DIP_LINK_ON_PRIMARY}}", "");
- }
+ http_content += "
";
+ http_content += "
Network
";
+ http_content += "
";
+ http_content += "
";
+ http_content += "
ON";
+ http_content += "
OFF";
+ http_content += "
";
// 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());
+ if (dip == 0) {
+ http_content += "
";
+ http_content += "";
+ http_content += "";
+ http_content += "
";
+ http_content += "
";
+ http_content += "";
+ http_content += "";
+ http_content += "
";
+ http_content += "
";
+ http_content += "";
+ http_content += "";
+ http_content += "
";
}
- http_content.replace("{{CONFIG_PAGE}}", config_content);
+ // The save button
+ http_content += "
";
+ http_content += "";
+ http_content += "
";
- // set the pwm values
- http_content.replace("{{PWM_MIN}}", (String)PWM_MIN);
- http_content.replace("{{PWM_MAX}}", (String)PWM_MAX);
+ http_content += "";
+
+ http_content += "";
+ http_content += "
";
+ http_content += "