Skip to content

Commit

Permalink
Merge pull request #10 from chathura-de-silva/dev
Browse files Browse the repository at this point in the history
Bug fix + Additional Model page
  • Loading branch information
chathura-de-silva authored Apr 27, 2024
2 parents ac731b3 + e03ad04 commit 6f8b821
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/alarms.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -129,8 +129,8 @@ void set_alarm(int alarm)
{
alarm_triggered[i] = true;
}
alarm_triggered[alarm] = false;
}
alarm_triggered[alarm] = false;

show_modal_page(alarm_ring, 1000, "Alarm set to " + formatNumber(temp_hour) + ":" + formatNumber(temp_minute), 10);
save_alarm(alarm);
Expand Down
2 changes: 1 addition & 1 deletion src/preferences.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ void load_user_settings()
preferences.begin("settings", true);
for (int i = 0; i < n_alarms; i++)
{
alarm_hours[i] = preferences.getInt("alarm_hours_" + i, 0); // default alarms set at ,1,2,3.
alarm_hours[i] = preferences.getInt("alarm_hours_" + i, 0); // Default(when no data in EEPROM) alarm time is 00:00. But will not trigger until user sets, since alarm_triggered is false.
alarm_minutes[i] = preferences.getInt("alarm_minutes_" + i, 00);
alarm_triggered[i] = preferences.getBool("alarm_triggered_" + i, false);
}
Expand Down
6 changes: 4 additions & 2 deletions src/utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ void run_mode(int mode)
}
else if (mode == 6)
{

reset_preferences();
}
}
Expand Down Expand Up @@ -169,7 +169,9 @@ void update_time_with_check_alarm()
{
for (int i = 0; i < n_alarms; i++)
{
// Serial.println("hours : " + String(timeinfo.tm_hour) + " Alram hours : " + String(alarm_hours[i])); //for debugging.
// Serial.println("Alarm No: " + String(i) + "Already Triggered : " + String(alarm_triggered[i])); // for debugging.
// Serial.println("H : " + String(timeinfo.tm_hour) + " Alarm hours : " + String(alarm_hours[i])); // for debugging.
// Serial.println("M : " + String(timeinfo.tm_min) + " Alarm hours : " + String(alarm_minutes[i])); // for debugging.
if (alarm_triggered[i] == false && alarm_hours[i] == timeinfo.tm_hour && alarm_minutes[i] == timeinfo.tm_min)
{
ring_alarm();
Expand Down
5 changes: 3 additions & 2 deletions src/webServer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ void config_wifi()
}
}
}

// Display the HTML web page with login form
client.println("<!DOCTYPE html><html>");
client.println("<head><meta name=\"viewport\" content=\"width=device-width, initial-scale=1\">");
Expand Down Expand Up @@ -142,8 +142,9 @@ void config_wifi()

// The HTTP response ends with another blank line
client.println();

// Break out of the while loop
show_modal_page(wifi_config, -1, "Waiting for Data...", 12);
break;
}
else
Expand Down

0 comments on commit 6f8b821

Please sign in to comment.