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

@ -41,6 +41,9 @@ async function temperatoTick() {
numberOfTicks++; numberOfTicks++;
if (numberOfTicks == TICK_THRESHOLD) { if (numberOfTicks == TICK_THRESHOLD) {
numberOfTicks = 0; numberOfTicks = 0;
}
if (numberOfTicks == 0) {
const basicAuth = Buffer.from(`${USERNAME}:${PASSWORD}`).toString('base64'); const basicAuth = Buffer.from(`${USERNAME}:${PASSWORD}`).toString('base64');
await fetch(NOTIF_URL, { await fetch(NOTIF_URL, {
method: 'post', method: 'post',