Update to include tick thresholds to avoid spammy messages

This commit is contained in:
William Moore 2022-05-28 16:50:56 -05:00
parent f1562451cc
commit ea26bc54ed

View File

@ -39,8 +39,11 @@ async function temperatoTick() {
if (response.getSensorData.temperato >= SET_POINT) {
numberOfTicks++;
if (numberOfTicks == TICK_THRESHOLD) {
numberOfTicks = 0;
if (numberOfTicks == TICK_THRESHOLD) {
numberOfTicks = 0;
}
if (numberOfTicks == 0) {
const basicAuth = Buffer.from(`${USERNAME}:${PASSWORD}`).toString('base64');
await fetch(NOTIF_URL, {
method: 'post',