From 5a7ca0f0e9a03cfd8a47a2836e4574bbd52f6812 Mon Sep 17 00:00:00 2001 From: Tanner Collin Date: Mon, 27 Jun 2022 17:31:45 -0600 Subject: [PATCH] Fix bugs --- main.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/main.py b/main.py index 75b0149..fb12292 100644 --- a/main.py +++ b/main.py @@ -37,7 +37,7 @@ async def play_sound(filename): await asyncio.sleep(0.1) -async def bark(sound): +async def barkbark(sound): global COOLDOWN if time.time() - COOLDOWN < 5.0: logging.info('Cooldown skipping.') @@ -65,17 +65,17 @@ async def process_mqtt(message): logging.info('Invalid json, returning') return - id_ = str(data.get('id', '')) + serial = str(data.get('serial', '')) - if id_ not in CAMERAS: - logging.info('Invalid id, returning') + if serial not in CAMERAS: + logging.info('Invalid serial, returning') return - camera = CAMERAS[id_] + camera = CAMERAS[serial] - logging.info('Ringing %s...', camera['name']) + logging.info('Barking %s...', camera['name']) - await ring_bell(doorbell['sound']) + await barkbark(camera['sound']) async def fetch_mqtt():