Fixed info telemetry field not updating immediately after settings change

This commit is contained in:
Mark Qvist 2024-04-01 14:38:19 +02:00
parent d3a27f4121
commit 8375ea224a
3 changed files with 8 additions and 3 deletions

View File

@ -2518,7 +2518,7 @@ class SidebandCore():
if self.config["telemetry_s_information"]: if self.config["telemetry_s_information"]:
self.telemeter.synthesize("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: else:
self.telemeter = None self.telemeter = None

View File

@ -331,6 +331,10 @@ class Information(Sensor):
def update_data(self): def update_data(self):
self.data = {"contents":str(self.contents)} self.data = {"contents":str(self.contents)}
def set_contents(self, contents):
self.contents = contents
self.update_data()
def pack(self): def pack(self):
if self.data == None: if self.data == None:
return None return None

View File

@ -436,12 +436,13 @@ class Telemetry():
self.app.sideband.config["telemetry_s_proximity"] = self.sensors_screen.ids.telemetry_s_proximity.active 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: 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 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: 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 run_telemetry_update = True
self.app.sideband.config["telemetry_s_information_text"] = self.sensors_screen.ids.telemetry_s_information_text.text
try: try:
alt = float(self.sensors_screen.ids.telemetry_s_fixed_altitude.text.strip().replace(" ", "")) alt = float(self.sensors_screen.ids.telemetry_s_fixed_altitude.text.strip().replace(" ", ""))