From 0f871915b255c52bc2cb8b794a45421036ca0dc2 Mon Sep 17 00:00:00 2001 From: Herman Bremnes <37117219+bernes1@users.noreply.github.com> Date: Tue, 12 Sep 2023 11:49:12 +0200 Subject: [PATCH] Addntfysh (#19) * add ntffy * woopise forgor to add ntfy notification --- src/index.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/index.js b/src/index.js index ae8bf8d..3a272ce 100644 --- a/src/index.js +++ b/src/index.js @@ -2,6 +2,7 @@ import dotenv from "dotenv"; import * as mqtt from "mqtt"; import {sendPushover, openmsg, closedmsg} from "./pushovernotify.js"; import {sendDiscordClosed, sendDiscordOpen} from "./discordnotify.js"; +import {sendNtfyClosed, sendNtfyOpen} from "./ntfy.js"; //dotenv config dotenv.config(); @@ -43,11 +44,14 @@ client.on("connect", () => { const parsePayload = payload.toString(); if ((previousState == States.open || previousState == States.default) && parsePayload == States.closed) { sendPushover(closedmsg); + sendNtfyClosed(); sendDiscordClosed(); console.log("CLOSED"); } else if ((previousState == States.closed || previousState == States.default) && parsePayload == States.open) { sendPushover(openmsg); + sendNtfyOpen(); sendDiscordOpen(); + sen console.log("OPEN"); } previousState = parsePayload;