A live bird collage card for your Home Assistant dashboard.
cleanup: thisrun.txt is not used anymore
frederik6717e5fde0a6
diff --git a/scripts/birdnet_analysis.py b/scripts/birdnet_analysis.pyindex e34aaf11..ea2a5cea 100644--- a/scripts/birdnet_analysis.py+++ b/scripts/birdnet_analysis.py@@ -12,7 +12,7 @@ import inotify.adaptersfrom inotify.constants import IN_CLOSE_WRITEfrom server import load_global_model, run_analysis-from utils.helpers import get_settings, ParseFileName, get_wav_files, write_settings, ANALYZING_NOW+from utils.helpers import get_settings, ParseFileName, get_wav_files, ANALYZING_NOWfrom utils.reporting import extract_detection, summary, write_to_file, write_to_db, apprise, bird_weather, heartbeat, \update_json_file@@ -28,7 +28,6 @@ def sig_handler(sig_num, curr_stack_frame):def main():- write_settings()load_global_model()conf = get_settings()i = inotify.adapters.Inotify()diff --git a/scripts/utils/helpers.py b/scripts/utils/helpers.pyindex 210e367d..0902c177 100644--- a/scripts/utils/helpers.py+++ b/scripts/utils/helpers.py@@ -12,7 +12,6 @@ from tzlocal import get_localzone_settings = NoneDB_PATH = os.path.expanduser('~/BirdNET-Pi/scripts/birds.db')-THISRUN = os.path.expanduser('~/BirdNET-Pi/scripts/thisrun.txt')ANALYZING_NOW = os.path.expanduser('~/BirdSongs/StreamData/analyzing_now.txt')@@ -43,14 +42,6 @@ def get_settings(settings_path='/etc/birdnet/birdnet.conf', force_reload=False):return settings-def write_settings(file_name=THISRUN):- settings = _load_settings()- with open(file_name, 'w') as configfile:- for key in settings.keys():- configfile.write(f'{key}={settings.get(key, raw=True)}\n')- os.chmod(file_name, stat.S_IRUSR | stat.S_IWUSR | stat.S_IRGRP | stat.S_IWGRP)--class Detection:def __init__(self, start_time, stop_time, species, confidence):self.start = float(start_time)