Skip to content

Commit

Permalink
User no longer needs to reset buttons manually. Suppressed 'All done'…
Browse files Browse the repository at this point in the history
… email message.
  • Loading branch information
Dennis-van-Gils committed Nov 6, 2024
1 parent e3e6733 commit b5b6fdc
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 12 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
Changelog
=========

2.0.0 (2024-11-06)
------------------
After the automated 'Chemicals delivered' email has been send to the user,
revert all buttons back to their idle off state. The user no longer has to
deactivate any lit buttons, and hence the 'All done' email message is now
suppressed.

1.0.0 (2021-10-28)
------------------
* Initial release
27 changes: 17 additions & 10 deletions source_mcu/src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ This project uses the following code editor:
GitHub: https://github.com/Dennis-van-Gils/project-WiFi-Chemicals-Delivery-Bell
Author: Dennis van Gils
Date : 12-11-2021
Date : 06-11-2024
*/

#include <Arduino.h>
Expand All @@ -37,9 +37,9 @@ Date : 12-11-2021
#include <StringReserveCheck.h>

#if __has_include("wifi_settings.h")
# include <wifi_settings.h>
#include <wifi_settings.h>
#else
# include <wifi_settings_template.h>
#include <wifi_settings_template.h>
#endif

// Serial monitor
Expand Down Expand Up @@ -179,13 +179,7 @@ class EmailScheduler {
Ser.println(pending_email ? "True\n" : "False\n");
}

bool poll() {
if ((pending_email) & (millis() - last_bump > T_delay)) {
reset();
return true;
}
return false;
}
bool poll() { return ((pending_email) & (millis() - last_bump > T_delay)); }
};

EmailScheduler email_scheduler;
Expand Down Expand Up @@ -712,5 +706,18 @@ void loop() {
screensaver.update();
if (email_scheduler.poll()) {
send_email();

// v2.0: After the automated 'Chemicals delivered' email has been send to
// the user, revert all buttons back to their idle off state. The user no
// longer has to deactivate any lit buttons, and hence the 'All done' email
// message is now suppressed.
request_LED_white = false;
request_LED_blue = false;
state_LED_white = false;
state_LED_blue = false;
write_LED_white(false);
write_LED_blue(false);
send_buttons(false, false);
email_scheduler.reset();
}
}
4 changes: 2 additions & 2 deletions web/chemicals_delivery/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,11 +68,11 @@
<?php
if ($status->white == true |
$status->blue == true) {
echo "Chemicals delivered";
echo "Email 'Chemicals delivered' will be send within one minute";
} elseif ($status->starting_up == true) {
echo "Arduino has (re)started";
} else {
echo "No chemicals awaiting";
echo "Waiting for a button press on the box";
}
?>
</h1>
Expand Down

0 comments on commit b5b6fdc

Please sign in to comment.