Compare commits

..

2 Commits

Author SHA1 Message Date
gilex-dev fc6c8c1e74 fix format warning 2023-11-13 21:43:40 +01:00
gilex-dev 0f29e89a50 add min temperature threshold 2023-11-13 20:41:30 +01:00
2 changed files with 25 additions and 4 deletions

View File

@ -3,6 +3,23 @@
void reload_home() // generates current time and changes variables in home_html
{
char time_current[3][3] = {"", "", ""};
if (myTime.hour() < 10) {
sprintf(time_current[0], "0%d", myTime.hour());
} else {
sprintf(time_current[0], "%d", myTime.hour());
}
if (myTime.minute() < 10) {
sprintf(time_current[1], "0%d", myTime.minute());
} else {
sprintf(time_current[1], "%d", myTime.minute());
}
if (myTime.second() < 10) {
sprintf(time_current[2], "0%d", myTime.second());
} else {
sprintf(time_current[2], "%d", myTime.second());
}
sprintf(home_html, "<!DOCTYPE html>\
<html lang='de'>\
<head>\
@ -63,7 +80,7 @@ top: 2px;\
<body>\
<div class='wrapper_main'>\
<h1>Übersicht</h1>\
<h2>Uhrzeit: <span>%02d:%02d:%02d</span></h2>\
<h2>Uhrzeit: <span>%s:%s:%s</span></h2>\
<div class='wrapper_form'>\
<div>\
<span>Ventil 1: </span>\
@ -76,7 +93,7 @@ top: 2px;\
</div>\
</body>\
</html>",
myTime.hour(), myTime.minute(), myTime.second(), stat[0]);
time_current[0], time_current[1], time_current[2], stat[0]);
}
void reload_settings() {

View File

@ -1,7 +1,7 @@
const char SSID[] = "";
const char PASSWORD[] = "";
const char version[] = " 0.8.3";
const char version[] = " 0.8.1";
#include "globalvars.h"
#include <Arduino.h>
#include <DallasTemperature.h>
@ -156,7 +156,11 @@ void load_EEPROM() {
unsigned int EEPROM_Addr = 0;
for (unsigned int i0 = 0; i0 < 8; i0++) {
for (unsigned int i = 0; i < 8; i++) {
sprintf(time_all[i0][i], "%02d", EEPROM.read(EEPROM_Addr));
if (EEPROM.read(EEPROM_Addr) < 10) {
sprintf(time_all[i0][i], "0%d", EEPROM.read(EEPROM_Addr));
} else {
sprintf(time_all[i0][i], "%d", EEPROM.read(EEPROM_Addr));
}
EEPROM_Addr += 4;
yield();
}