X-Git-Url: http://www.average.org/gitweb/?a=blobdiff_plain;f=loctrkd%2Fbeesure.py;h=baf14dbee9600eb25252f9d44ea38c80fac0890a;hb=be1de0bb68c5c4acf2edd6f04c5ea8e40d9f31fb;hp=93216c98ca39ce8ce570aff7cb7033ee6b556620;hpb=023da3cd78841eb34d8286cf289995be658f0fa2;p=loctrkd.git diff --git a/loctrkd/beesure.py b/loctrkd/beesure.py index 93216c9..baf14db 100755 --- a/loctrkd/beesure.py +++ b/loctrkd/beesure.py @@ -351,29 +351,29 @@ class _LOC_DATA(BeeSurePkt): self.latitude = p.lat * p.nors self.longitude = p.lon * p.eorw - def rectified(self) -> Dict[str, Any]: # JSON-able dict + def rectified(self) -> SimpleNamespace: # JSON-able dict if self.gps_valid: - return { - "type": "location", - "devtime": str(self.devtime), - "battery_percentage": self.battery_percentage, - "accuracy": self.positioning_accuracy, - "altitude": self.altitude, - "speed": self.speed, - "direction": self.direction, - "latitude": self.latitude, - "longitude": self.longitude, - } + return SimpleNamespace( + type="location", + devtime=str(self.devtime), + battery_percentage=self.battery_percentage, + accuracy=self.positioning_accuracy, + altitude=self.altitude, + speed=self.speed, + direction=self.direction, + latitude=self.latitude, + longitude=self.longitude, + ) else: - return { - "type": "approximate_location", - "devtime": str(self.devtime), - "battery_percentage": self.battery_percentage, - "mcc": self.mcc, - "mnc": self.mnc, - "base_stations": self.base_stations, - "wifi_aps": self.wifi_aps, - } + return SimpleNamespace( + type="approximate_location", + devtime=str(self.devtime), + battery_percentage=self.battery_percentage, + mcc=self.mcc, + mnc=self.mnc, + base_stations=self.base_stations, + wifi_aps=self.wifi_aps, + ) class AL(_LOC_DATA):