mirror of
https://github.com/alexbelgium/hassio-addons.git
synced 2026-05-27 10:54:14 +02:00
Update birdnet_to_mqtt.py
This commit is contained in:
@@ -18,7 +18,6 @@ import paho.mqtt.client as mqtt
|
|||||||
# 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:
|
||||||
@@ -54,7 +53,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('/test')
|
syslog = open('/proc/1/fd/1', 'r')
|
||||||
|
|
||||||
# this little hack is to make each received record for the all birds section unique
|
# this little hack is to make each received record for the all birds section unique
|
||||||
# the date and time that the log returns is only down to the 1 second accuracy, do
|
# the date and time that the log returns is only down to the 1 second accuracy, do
|
||||||
|
|||||||
Reference in New Issue
Block a user