mirror of
https://github.com/liberatedsystems/Sideband_CE.git
synced 2024-09-03 04:13:27 +02:00
Added support for location provider plugins
This commit is contained in:
parent
c93fe2ce0d
commit
6122df0600
@ -620,6 +620,7 @@ class Location(Sensor):
|
||||
self._min_distance = Location.MIN_DISTANCE
|
||||
self._accuracy_target = Location.ACCURACY_TARGET
|
||||
self._query_method = None
|
||||
self._synthesized_updates = False
|
||||
|
||||
self.latitude = None
|
||||
self.longitude = None
|
||||
@ -679,12 +680,17 @@ class Location(Sensor):
|
||||
self._raw = kwargs
|
||||
self._last_update = time.time()
|
||||
|
||||
def set_update_time(self, update_time):
|
||||
self._synthesized_updates = True
|
||||
self._last_update = update_time
|
||||
|
||||
def update_data(self):
|
||||
try:
|
||||
if self.synthesized:
|
||||
if self.latitude != None and self.longitude != None:
|
||||
|
||||
now = time.time()
|
||||
if not self._synthesized_updates:
|
||||
if self._last_update == None:
|
||||
self._last_update = now
|
||||
elif now > self._last_update + self._stale_time:
|
||||
|
Loading…
Reference in New Issue
Block a user