From 8375ea224a064ac2a93c50543efa45ec80935849 Mon Sep 17 00:00:00 2001 From: Mark Qvist Date: Mon, 1 Apr 2024 14:38:19 +0200 Subject: [PATCH] Fixed info telemetry field not updating immediately after settings change --- sbapp/sideband/core.py | 2 +- sbapp/sideband/sense.py | 4 ++++ sbapp/ui/telemetry.py | 5 +++-- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/sbapp/sideband/core.py b/sbapp/sideband/core.py index 80ce3e0..d457f7a 100644 --- a/sbapp/sideband/core.py +++ b/sbapp/sideband/core.py @@ -2518,7 +2518,7 @@ class SidebandCore(): if self.config["telemetry_s_information"]: self.telemeter.synthesize("information") - self.telemeter.sensors["information"].contents = self.config["telemetry_s_information_text"] + self.telemeter.sensors["information"].set_contents(self.config["telemetry_s_information_text"]) else: self.telemeter = None diff --git a/sbapp/sideband/sense.py b/sbapp/sideband/sense.py index b64f36c..ecf8ea0 100644 --- a/sbapp/sideband/sense.py +++ b/sbapp/sideband/sense.py @@ -331,6 +331,10 @@ class Information(Sensor): def update_data(self): self.data = {"contents":str(self.contents)} + def set_contents(self, contents): + self.contents = contents + self.update_data() + def pack(self): if self.data == None: return None diff --git a/sbapp/ui/telemetry.py b/sbapp/ui/telemetry.py index cd79bdc..71858b5 100644 --- a/sbapp/ui/telemetry.py +++ b/sbapp/ui/telemetry.py @@ -436,12 +436,13 @@ class Telemetry(): self.app.sideband.config["telemetry_s_proximity"] = self.sensors_screen.ids.telemetry_s_proximity.active if self.app.sideband.config["telemetry_s_information"] != self.sensors_screen.ids.telemetry_s_information.active: - self.app.sideband.config["telemetry_s_information"] = self.sensors_screen.ids.telemetry_s_information.active run_telemetry_update = True + self.app.sideband.config["telemetry_s_information"] = self.sensors_screen.ids.telemetry_s_information.active if self.app.sideband.config["telemetry_s_information_text"] != self.sensors_screen.ids.telemetry_s_information_text.text: - self.app.sideband.config["telemetry_s_information_text"] = self.sensors_screen.ids.telemetry_s_information_text.text run_telemetry_update = True + self.app.sideband.config["telemetry_s_information_text"] = self.sensors_screen.ids.telemetry_s_information_text.text + try: alt = float(self.sensors_screen.ids.telemetry_s_fixed_altitude.text.strip().replace(" ", ""))