enhance code with inital brodcaster

https://github.com/SpudGunMan/meshing-around/issues/51 referenced in this enhancement. this is partially implemented for now in code
This commit is contained in:
SpudGunMan
2024-08-27 16:06:52 -07:00
parent 9d7e42aa60
commit c4ef1251c9
3 changed files with 31 additions and 0 deletions
+1
View File
@@ -24,6 +24,7 @@ max_retry_count1 = 4 # max retry count for interface 1
max_retry_count2 = 4 # max retry count for interface 2
retry_int1 = False
retry_int2 = False
scheduler_enabled = False # enable the scheduler currently config via code only
# Read the config file, if it does not exist, create basic config file
config = configparser.ConfigParser()
+14
View File
@@ -64,6 +64,13 @@ if dad_jokes_enabled:
trap_list = trap_list + ("joke",)
help_message = help_message + ", joke"
# Scheduled Broadcast Configuration
if scheduler_enabled:
import schedule # pip install schedule
# Reminder Scheduler is enabled every day at noon
schedule.every().day.at("12:00").do(logger.info, "Scheduler: Reminder Scheduler is enabled")
# Sentry Configuration
if sentry_enabled:
from math import sqrt
import geopy.distance # pip install geopy
@@ -323,6 +330,7 @@ def get_node_location(number, nodeInt=1, channel=0):
else:
logger.warning(f"System: No nodes found")
return position
return position
def get_closest_nodes(nodeInt=1,returnCount=3):
node_list = []
@@ -508,6 +516,12 @@ def exit_handler():
asyncLoop.close()
exit (0)
async def BroadcastScheduler():
# handle schedule checks for the broadcast of messages
while True:
schedule.run_pending()
await asyncio.sleep(1)
async def handleSignalWatcher():
global lastHamLibAlert, antiSpam, sigWatchBrodcastCh
# monitor rigctld for signal strength and frequency