File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -37,8 +37,11 @@ def command_active_monitor(command: str, active: bool):
3737dataref = ws .dataref ("sim/cockpit2/clock_timer/local_time_seconds" )
3838ws .monitor_dataref (dataref )
3939
40- arrdref = ws .dataref ("sim/weather/aircraft/wind_direction_degt[0]" )
41- ws .monitor_dataref (arrdref )
40+ arrdrefall = ws .dataref ("sim/weather/region/wind_altitude_msl_m" ) # does not change a lot when not moving
41+ ws .monitor_dataref (arrdrefall )
42+
43+ arrdref1 = ws .dataref ("sim/weather/aircraft/wind_direction_degt[0]" )
44+ ws .monitor_dataref (arrdref1 )
4245
4346ws .monitor_command_active (ws .command ("sim/map/show_current" ))
4447
Original file line number Diff line number Diff line change @@ -473,6 +473,10 @@ def value(self, value):
473473 if self .auto_save :
474474 self .write ()
475475
476+ def get_value (self ):
477+ """Return current value of dataref in local application"""
478+ return self ._new_value if self ._new_value is not None else self .api .dataref_value (self )
479+
476480 def get_string_value (self , encoding : str ) -> str | None :
477481 """Decodes current dataref value and replaces it with the decoded string value
478482
@@ -485,7 +489,8 @@ def get_string_value(self, encoding: str) -> str | None:
485489 if self .value_type not in ["data" ]:
486490 logger .warning ("value type is not data" )
487491 return None
488- value_bytes = self .value
492+ # https://stackoverflow.com/questions/1021464/how-to-call-a-property-of-the-base-class-if-this-property-is-being-overwritten-i
493+ value_bytes = Dataref .value .fget (self ) # make sure we call OUT .value property (if overwritten)
489494 if value_bytes is None :
490495 logger .debug ("no value" )
491496 return None
You can’t perform that action at this time.
0 commit comments