diff --git a/index.py b/index.py index 3a8c76b..47fedd4 100644 --- a/index.py +++ b/index.py @@ -211,6 +211,8 @@ def on_message(client, userdata, message): _LOGGER.debug(f"duplicated snapshot from Frigate as top_score from before and after are the same: {after_data['top_score']}") return + # get frigate event + frigate_event = after_data['id'] frigate_url = config['frigate']['frigate_url'] snapshot_url = f"{frigate_url}/api/events/{frigate_event}/snapshot.jpg" _LOGGER.debug(f"event URL: {snapshot_url}") @@ -235,8 +237,6 @@ def on_message(client, userdata, message): _LOGGER.debug(f"license_plate attribute score is below minimum: {license_plate_attribute[0]['score']}") return - # get frigate event - frigate_event = after_data['id'] # see if we have already processed this event conn = sqlite3.connect(DB_PATH)