Compare commits

..

1 Commits

Author SHA1 Message Date
77d6968297 [P] Fix map lat, lon confusion
All checks were successful
Component testing / Hub testing (push) Successful in 23s
Component testing / Store testing (push) Successful in 18s
Component testing / Integration smoke testing (push) Successful in 2m22s
2026-03-25 14:57:38 +02:00
3 changed files with 5 additions and 7 deletions

View File

@@ -72,8 +72,8 @@ class Datasource:
)
new_points = [
(
processed_agent_data.latitude,
processed_agent_data.longitude,
processed_agent_data.latitude,
processed_agent_data.road_state,
processed_agent_data.user_id
)

View File

@@ -87,7 +87,8 @@ class MapViewApp(App):
self.car_markers[user_id].lat = lat
self.car_markers[user_id].lon = lon
self.mapview.center_on(lat, lon)
if user_id == 1:
self.mapview.center_on(lat, lon)
def set_pothole_marker(self, point):
if isinstance(point, dict):

View File

@@ -16,8 +16,6 @@ def connect_mqtt(broker, port):
print("Failed to connect {broker}:{port}, return code %d\n", rc)
exit(rc) # Stop execution
logging.info(f"Acting as USER_ID = {config.USER_ID}")
client = mqtt_client.Client()
client.on_connect = on_connect
client.connect(broker, port)
@@ -31,14 +29,13 @@ def publish(client, topic, datasource):
data = datasource.read()
msg = AggregatedDataSchema().dumps(data)
result = client.publish(topic, msg)
logging.debug(f"Published to {topic}: {msg[:50]}...")
logging.info(f"Published to {topic}: {msg[:50]}...")
status = result[0]
if status != 0:
logging.error(f"Failed to send message to topic {topic}")
print(f"Failed to send message to topic {topic}")
def run():
logging.basicConfig(level = logging.INFO)
# Prepare mqtt client
client = connect_mqtt(config.MQTT_BROKER_HOST, config.MQTT_BROKER_PORT)
# Prepare datasource