From a1a197c7ee589bc31eb65faa0776b1ef69fe8850 Mon Sep 17 00:00:00 2001 From: polyfloyd Date: Sun, 1 Jun 2025 19:22:31 +0200 Subject: [PATCH] Add doorduino messages --- commands/__init__.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/commands/__init__.py b/commands/__init__.py index 5570faa..e33820c 100644 --- a/commands/__init__.py +++ b/commands/__init__.py @@ -89,6 +89,9 @@ async def np(ctx): async def run_events(mqtt_host): retained = { "bitlair/alarm", + "bitlair/doorduino/doorbell", + "bitlair/doorduino/dooropen", # Unused. Payload is 0|1 like the doorbell. + "bitlair/doorduino/lockstate", "bitlair/photos", "bitlair/state", "bitlair/state/djo", @@ -110,6 +113,10 @@ async def run_events(mqtt_host): yield f"Bitlair is now {payload.upper()}" elif msg.topic.matches("bitlair/state/djo"): yield f"DJO is now {payload.upper()}" + elif msg.topic.matches("bitlair/doorduino/lockstate"): + yield f"Doorduino: lockstate {payload.upper()}" + elif msg.topic.matches("bitlair/doorduino/doorbell") and payload == "1": + yield "DEURBEL! Open de deur beneden!" elif msg.topic.matches("bitlair/photos"): embed = DiscordEmbed(title="WIP Cam", color="fc5d1d") embed.set_url(f"https://bitlair.nl/fotos/view/{payload}")