diff --git a/README.md b/README.md index 21f6b23..6519a88 100755 --- a/README.md +++ b/README.md @@ -94,6 +94,12 @@ If you reach out to me and have an error, please include what error you are gett ## Change Log Changes Prior to current year have been moved to the [ChangeLog](https://n8acl.github.io/aprsnotify/changelog/) on the wiki. +## Version 1.0.1 - Released 11/23/2024 +## Changed +- Fixed a couple of bugs with handling message notifcations + + + ## Version 1.0.0 - Released 10/30/2024 ## Added - Now uses the Apprise notification library for service notifiction support. diff --git a/aprsnotify.py b/aprsnotify.py index 8fffcbd..121931e 100755 --- a/aprsnotify.py +++ b/aprsnotify.py @@ -69,6 +69,7 @@ server_timezone = "Etc/UTC" localFormat = "%Y-%m-%d %H:%M:%S" localFormat_time = "%H:%M:%S" +localFormat_date = "%Y-%m-%d" ###################################################################################################################### ## Define Functions @@ -500,25 +501,25 @@ def send_msg(apobj, tag, msg, title): data = get_api_data_payload(aprsfi_url,aprsfi_msg_payload) for x in range(0,data['found']): - if int(data['entries'][x]["time"]) > get_last_timestamp(data['entries'][x]["dst"],'MSG'): + if int(data['entries'][x]["messageid"]) > get_last_timestamp(data['entries'][x]["dst"],'MSG'): srccall = data['entries'][x]["srccall"] dstcall = data['entries'][x]["dst"] msg = data['entries'][x]["message"] dtstamp = data['entries'][x]["time"] lastmsgid = data['entries'][x]["messageid"] - msg_timestamp = datetime.datetime.fromtimestamp(int(dtstamp)).strftime('%H:%M:%S') - msg_datestamp = datetime.datetime.fromtimestamp(int(dtstamp)).strftime('%m/%d/%Y') + msg_timestamp = convert_local_time(int(dtstamp)).strftime(localFormat_time) + msg_datestamp = convert_local_time(int(dtstamp)).strftime(localFormat_date) # create msg status and send to Telegram msg_status = "On " + msg_datestamp + " at " + msg_timestamp + ", " + srccall + " sent " + dstcall + " the following APRS message: " + msg title = "Message Notification" if use_apprise_api: - send_msg_api('MSG', status, title) + send_msg_api('MSG', msg_status, title) else: - send_msg(apobj, 'MSG', status, title) + send_msg(apobj, 'MSG', msg_status, title) - update_last_timestamp(station,'MSG', lastmsgid) + update_last_timestamp(dstcall,'MSG', lastmsgid) sleep(delay_time)