Compare commits
No commits in common. "790c848cc076d874ed7f99753a8227e567103068" and "93c9a02deb908187add5d55136697887ac985f91" have entirely different histories.
790c848cc0
...
93c9a02deb
5 changed files with 12 additions and 11 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 5
|
||||
#define BRI_MOD_STEPS_PER_SEC 25.0
|
||||
|
||||
#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(512);
|
||||
DynamicJsonDocument root(1024);
|
||||
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(512);
|
||||
root["on"] = light_state[light];
|
||||
root["bri"] = bri[light];
|
||||
DynamicJsonDocument root(1024);
|
||||
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 static HTML page ***** //
|
||||
// ***** Generate HTML page ***** //
|
||||
|
||||
String tmp1 = genHMTLTop();
|
||||
|
||||
|
|
|
@ -329,7 +329,6 @@ 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,6 +151,8 @@ 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())
|
||||
{
|
||||
|
@ -167,10 +169,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