mirror of
https://github.com/alexbelgium/hassio-addons.git
synced 2026-05-22 08:41:50 +02:00
Update birdnet_to_mqtt.py
This commit is contained in:
@@ -23,6 +23,7 @@ logging.basicConfig(level=logging.INFO)
|
|||||||
# this generator function monitors the requested file handle for new lines added at its end
|
# this generator function monitors the requested file handle for new lines added at its end
|
||||||
# the newly added line is returned by the function
|
# the newly added line is returned by the function
|
||||||
def file_row_generator(s):
|
def file_row_generator(s):
|
||||||
|
s.seek(0,2)
|
||||||
while True :
|
while True :
|
||||||
line = s.readline()
|
line = s.readline()
|
||||||
if not line:
|
if not line:
|
||||||
@@ -51,7 +52,7 @@ re_log_timestamp = re.compile(r'.+?(?= birdnet-)')
|
|||||||
re_high_found = re.compile(r'(?<=python3\[).*\.mp3$')
|
re_high_found = re.compile(r'(?<=python3\[).*\.mp3$')
|
||||||
re_high_clean = re.compile(r'(?<=\]:).*\.mp3$')
|
re_high_clean = re.compile(r'(?<=\]:).*\.mp3$')
|
||||||
|
|
||||||
syslog = open('/proc/1/fd/1', 'r')
|
syslog = open('/config/BirdDB.txt', 'r')
|
||||||
|
|
||||||
def on_connect(client, userdata, flags, rc, properties=None):
|
def on_connect(client, userdata, flags, rc, properties=None):
|
||||||
""" Callback for when the client receives a CONNACK response from the server. """
|
""" Callback for when the client receives a CONNACK response from the server. """
|
||||||
|
|||||||
Reference in New Issue
Block a user