A live bird collage card for your Home Assistant dashboard.
Bugfix: whitelist_species_list.txt will now overrule the Species Occurrence Frequency Threshold (#365)
no-username-found09d5d9950dd4
diff --git a/scripts/server.py b/scripts/server.pyindex 85522349..eb0db990 100644--- a/scripts/server.py+++ b/scripts/server.py@@ -135,9 +135,6 @@ def predictSpeciesList(lat, lon, week):# if there's a custom user-made include list, we only want to use the species in thatif (len(INCLUDE_LIST) == 0):PREDICTED_SPECIES_LIST.append(s[1])- WHITELIST_LIST = loadCustomSpeciesList(os.path.expanduser("~/BirdNET-Pi/whitelist_species_list.txt"))- for species in WHITELIST_LIST:- PREDICTED_SPECIES_LIST.append(species)def loadCustomSpeciesList(path):@@ -310,9 +307,10 @@ def load_global_model():def run_analysis(file):- global INCLUDE_LIST, EXCLUDE_LIST+ global INCLUDE_LIST, EXCLUDE_LIST, WHITELIST_LISTINCLUDE_LIST = loadCustomSpeciesList(os.path.expanduser("~/BirdNET-Pi/include_species_list.txt"))EXCLUDE_LIST = loadCustomSpeciesList(os.path.expanduser("~/BirdNET-Pi/exclude_species_list.txt"))+ WHITELIST_LIST = loadCustomSpeciesList(os.path.expanduser("~/BirdNET-Pi/whitelist_species_list.txt"))conf = get_settings()@@ -335,7 +333,7 @@ def run_analysis(file):log.warning("Excluded as INCLUDE_LIST is active but this species is not in it: %s", entry[0])elif entry[0] in EXCLUDE_LIST and len(EXCLUDE_LIST) != 0:log.warning("Excluded as species in EXCLUDE_LIST: %s", entry[0])- elif entry[0] not in PREDICTED_SPECIES_LIST and len(PREDICTED_SPECIES_LIST) != 0:+ elif entry[0] not in PREDICTED_SPECIES_LIST and len(PREDICTED_SPECIES_LIST) != 0 and entry[0] not in WHITELIST_LIST:log.warning("Excluded as below Species Occurrence Frequency Threshold: %s", entry[0])else:d = Detection(