File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed
Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -1391,7 +1391,13 @@ String getPressureSymbol()
13911391// converts the dBm to a range between 0 and 100%
13921392int8_t getWifiQuality () {
13931393 int32_t dbm = WiFi.RSSI ();
1394- if (dbm <= -100 ) {
1394+ // found out that RSSI returns 31 when wifi connection is lost
1395+ // we return -1 in that case
1396+ if (dbm > 0 )
1397+ {
1398+ return -1 ; // wifi error
1399+ }
1400+ else if (dbm <= -100 ) {
13951401 return 0 ;
13961402 } else if (dbm >= -50 ) {
13971403 return 100 ;
@@ -1548,7 +1554,7 @@ void readConfiguration() {
15481554 line.trim ();
15491555 // print each line read
15501556 if (1 ) {
1551- int idx = line.indexOf (" Key" );
1557+ idx = line.indexOf (" Key" );
15521558 if (idx < 0 ) idx = line.indexOf (" KEY" );
15531559 if (idx < 0 ) idx = line.indexOf (" Pass" );
15541560 if (idx > 0 ) idx = line.indexOf (" =" );
You can’t perform that action at this time.
0 commit comments