Skip to content

Commit

Permalink
fix missing return value
Browse files Browse the repository at this point in the history
  • Loading branch information
ljmerza committed Feb 12, 2024
1 parent bb97f1b commit d2ad24b
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions index.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
first_message = True
_LOGGER = None

VERSION = '1.8.11'
VERSION = '1.8.12'

CONFIG_PATH = '/config/config.yml'
DB_PATH = '/config/frigate_plate_recogizer.db'
Expand Down Expand Up @@ -143,15 +143,15 @@ def check_watched_plates(plate_number, response):
config_watched_plates = config['frigate'].get('watched_plates', [])
if not config_watched_plates:
_LOGGER.debug("Skipping checking Watched Plates because watched_plates is not set")
return None, None
return None, None, None

config_watched_plates = [str(x).lower() for x in config_watched_plates] #make sure watched_plates are all lower case

#Step 1 - test if top plate is a watched plate
matching_plate = str(plate_number).lower() in config_watched_plates
if matching_plate:
_LOGGER.info(f"Recognised plate is a Watched Plate: {plate_number}")
return None, None, None
return None, None, None

#Step 2 - test against AI candidates:
for i, plate in enumerate(response):
Expand Down Expand Up @@ -192,8 +192,6 @@ def check_watched_plates(plate_number, response):
_LOGGER.debug("No matching Watched Plates found.")
#No watched_plate matches found
return None, None, None



def send_mqtt_message(plate_number, plate_score, frigate_event_id, after_data, formatted_start_time, watched_plate, fuzzy_score):
if not config['frigate'].get('return_topic'):
Expand Down

0 comments on commit d2ad24b

Please sign in to comment.