From 237f6693f70f1e84cb5160eb6d20feb60ac913cb Mon Sep 17 00:00:00 2001 From: Mark Qvist Date: Sun, 31 Dec 2023 00:09:23 +0100 Subject: [PATCH] Fixed stale time updates on fixed location --- sbapp/sideband/core.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/sbapp/sideband/core.py b/sbapp/sideband/core.py index 0a70a20..4399ff3 100644 --- a/sbapp/sideband/core.py +++ b/sbapp/sideband/core.py @@ -2348,7 +2348,10 @@ class SidebandCore(): self.telemeter.sensors["location"].latitude = self.config["telemetry_s_fixed_latlon"][0] self.telemeter.sensors["location"].longitude = self.config["telemetry_s_fixed_latlon"][1] self.telemeter.sensors["location"].altitude = self.config["telemetry_s_fixed_altitude"] - self.telemeter.sensors["location"].stale_time = 30 + self.telemeter.sensors["location"].stale_time = 12*60*60 + + if time.time() > self.telemeter.sensors["location"].last_update + self.telemeter.sensors["location"].stale_time: + self.telemeter.sensors["location"].update_data() if self.config["telemetry_s_information"]: self.telemeter.synthesize("information") @@ -2592,7 +2595,8 @@ class SidebandCore(): if self.is_service or self.is_standalone: while True: time.sleep(SidebandCore.PERIODIC_JOBS_INTERVAL) - self.owner_service.update_location_provider() + if self.owner_service != None: + self.owner_service.update_location_provider() if self.config["lxmf_periodic_sync"] == True: if self.getpersistent("lxmf.lastsync") == None: