Compare commits
3 commits
93c9a02deb
...
790c848cc0
Author | SHA1 | Date | |
---|---|---|---|
|
790c848cc0 | ||
|
6e4b75025f | ||
|
4cb1007062 |
5 changed files with 11 additions and 12 deletions
Binary file not shown.
|
@ -18,7 +18,7 @@
|
|||
#define EEPROM_LAST_STATE_ADDRESS 4 // the first "last state" information for the first light
|
||||
#define EEPROM_TIMING_DATA_ADDRESS (EEPROM_LAST_STATE_ADDRESS + LIGHTS_COUNT) // Stored data date per light ELE_USED; HH; MM; CH1; CH2; CH3; CH4;
|
||||
|
||||
#define BRI_MOD_STEPS_PER_SEC 25.0
|
||||
#define BRI_MOD_STEPS_PER_SEC 5
|
||||
|
||||
#define TIME_CHECK_INTERVAL_MS (60000UL) // 60 second interval
|
||||
#define TIME_LIGHTENGINE_INTERVAL_MS (1000UL / BRI_MOD_STEPS_PER_SEC) // BRI_MOD_STEPS_PER_SEC steps per second to in-/decrease the brightness
|
||||
|
|
|
@ -381,7 +381,7 @@ void init_webserver()
|
|||
|
||||
server.on("/state", HTTP_PUT, []()
|
||||
{ // HTTP PUT request used to set a new light state
|
||||
DynamicJsonDocument root(1024);
|
||||
DynamicJsonDocument root(512);
|
||||
DeserializationError error = deserializeJson(root, server.arg("plain"));
|
||||
|
||||
if (error) {
|
||||
|
@ -448,9 +448,9 @@ void init_webserver()
|
|||
server.on("/state", HTTP_GET, []()
|
||||
{ // HTTP GET request used to fetch current light state
|
||||
uint8_t light = server.arg("light").toInt() - 1;
|
||||
DynamicJsonDocument root(1024);
|
||||
root["on"] = light_state[light];
|
||||
root["bri"] = bri[light];
|
||||
DynamicJsonDocument root(512);
|
||||
root["on"] = light_state[light];
|
||||
root["bri"] = bri[light];
|
||||
root["curbri"] = (int)current_bri[light];
|
||||
root["curpwm"] = current_pwm[light];
|
||||
String output;
|
||||
|
@ -688,7 +688,7 @@ void init_webserver()
|
|||
ESP.reset();
|
||||
}
|
||||
|
||||
// ***** Generate HTML page ***** //
|
||||
// ***** Generate static HTML page ***** //
|
||||
|
||||
String tmp1 = genHMTLTop();
|
||||
|
||||
|
|
|
@ -329,6 +329,7 @@ function updateLightState() {
|
|||
briSlider.value = data.bri;
|
||||
briSliderVal.innerHTML = (Math.round((data.bri * 100.0 / 255.0) * 100) / 100).toFixed(2);
|
||||
//console.log('data.on ' + i + ' = ' + data.on);
|
||||
//console.log('data light ' + i + ' = ' + data);
|
||||
if (data.on == true) {
|
||||
onLinkOn.classList.add('pure-button-primary');
|
||||
onLinkOff.classList.remove('pure-button-primary');
|
||||
|
|
|
@ -151,8 +151,6 @@ void tc_update_main()
|
|||
{
|
||||
//Serial.println((String)tc_data[i].hh + ":" + (String)tc_data[i].mm);
|
||||
|
||||
/*if (tc_data[i].hh <= timeClient.getHours() &&
|
||||
tc_data[i].mm <= timeClient.getMinutes())*/
|
||||
if (tc_data[i].hh <= hour() &&
|
||||
tc_data[i].mm <= minute())
|
||||
{
|
||||
|
@ -169,10 +167,10 @@ void tc_update_main()
|
|||
// disable the lights
|
||||
for (uint8_t i = 0; i < LIGHTS_COUNT; i++)
|
||||
{
|
||||
light_state[i] = false;
|
||||
bri[i] = 0;
|
||||
current_bri[i] = 0;
|
||||
current_pwm[i] = 0;
|
||||
light_state[i] = false;
|
||||
bri[i] = 0;
|
||||
current_bri[i] = 0;
|
||||
current_pwm[i] = 0;
|
||||
transitiontime[i] = 4;
|
||||
process_lightdata(i, transitiontime[i]);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue