Skip to content

Commit d5f067b

Browse files
committed
fix altruist
1 parent 24e262d commit d5f067b

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

connectivity/src/sensors/sensors_types/altruist.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,13 @@ def __post_init__(self) -> None:
2828
sensors_data: str = self.data["sensordatavalues"]
2929
self.measurement = None
3030
if not self._check_signature(sensors_data):
31-
print(f"Altrusit sensor: Signature is not verified")
31+
print(f"Altruist sensor: Signature is not verified")
3232
return
3333
elif not self._is_address_in_subscription():
34-
print(f"Altrusit sensor: Address is not in subscription")
34+
print(f"Altruist sensor: Address is not in subscription")
3535
return
36-
self.geo_lat = sensors_data["lat"]
37-
self.geo_lon = sensors_data["lon"]
36+
self.geo_lat = sensors_data["GPS_lat"]
37+
self.geo_lon = sensors_data["GPS_lon"]
3838

3939
self._measurements_formatter(sensors_data)
4040
self.timestamp = int(time.time())

tests/altruist_test.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,15 @@ def main():
2020
temperature = round(random.uniform(-50, 50), 3)
2121
lat = round(random.uniform(0.000000, 60.000000), 6)
2222
lon = round(random.uniform(0.000000, 49.999999), 6)
23-
id = round(random.randrange(0, 100000))
2423
body = {
2524
"robonomics_address": "",
2625
"owner": "",
2726
"signature": "",
2827
"software_version": "NRZ-2020-129",
2928
"donated_by": "Robonomics",
30-
"sensordatavalues": f"nm:0.00,na:0.00,lat:{lat},lon:{lon}"
29+
"GPS_lat": lat,
30+
"GPS_lon": lon,
31+
"sensordatavalues": f"nm:0.00,na:0.00,t:{temperature},p:360,h:{humidity},p1:{pm10},p2:{pm25}"
3132
}
3233

3334
try:

0 commit comments

Comments
 (0)