mirror of
https://github.com/jketterl/openwebrx.git
synced 2026-01-06 16:50:01 +01:00
make sure we are working with the right type
This commit is contained in:
parent
d0c0d6fe5f
commit
86e606a22e
|
|
@ -30,9 +30,13 @@ class AdsbLocation(IncrementalUpdate, AirplaneLocation):
|
|||
super().__init__(message)
|
||||
|
||||
def update(self, previousLocation: Location):
|
||||
history = previousLocation.history
|
||||
now = datetime.now()
|
||||
history = [p for p in history if now - p["timestamp"] < self.getTTL()]
|
||||
if isinstance(previousLocation, AdsbLocation):
|
||||
history = previousLocation.history
|
||||
now = datetime.now()
|
||||
history = [p for p in history if now - p["timestamp"] < self.getTTL()]
|
||||
else:
|
||||
history = []
|
||||
|
||||
history += [{
|
||||
"timestamp": self.timestamp,
|
||||
"props": self.props,
|
||||
|
|
|
|||
Loading…
Reference in a new issue