Changed sleep conditions and fixed bug in config

This commit is contained in:
Magnus 2021-03-30 12:55:47 +02:00
parent 22defdadc0
commit df1605bddf
2 changed files with 6 additions and 3 deletions

View File

@ -32,8 +32,11 @@ Config myConfig;
//
Config::Config() {
// Assiging default values
sprintf(&id[0], "%6x", (unsigned int) ESP.getChipId() );
sprintf(&mDNS[0], "" WIFI_MDNS "%s", getID() );
char buf[20];
sprintf(&buf[0], "%6x", (unsigned int) ESP.getChipId() );
id = &buf[0];
sprintf(&buf[0], "" WIFI_MDNS "%s", getID() );
mDNS = &buf[0];
setTempFormat('C');
setPushInterval(900); // 15 minutes
setVoltageFactor(1.59); // Conversion factor for battery

View File

@ -80,7 +80,7 @@ void checkSleepMode( float angle, float volt ) {
}
// Will not enter sleep mode if: charger is connected
sleepModeActive = volt<4.15 ? true : false;
sleepModeActive = (volt<4.15 && angle>85) || (volt>4.15) ? false : true;
// sleep mode active when flat
//sleepModeActive = ( angle<85 && angle>5 ) ? true : false;