fix get_locator_beacon

This commit is contained in:
Laura Klünder 2023-11-23 15:02:21 +01:00
parent 995f17c138
commit d84226dc5c
3 changed files with 14 additions and 7 deletions

View file

@ -50,6 +50,13 @@ class RangeLocator:
def load_nocache(cls, update):
return pickle.load(open(cls.build_filename(update), 'rb'))
def get_xyz(self, address) -> tuple[int, int, int] | None:
try:
i = self.beacon_lookup[address]
except KeyError:
return None
return tuple(self.beacon_positions[i])
cached = None
cache_update = None
cache_lock = threading.Lock()