Add doorduino messages

This commit is contained in:
polyfloyd 2025-06-01 19:22:31 +02:00
parent cc7184e453
commit a1a197c7ee

View file

@ -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}")