Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Publish retained messages #555

Merged
merged 2 commits into from
May 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions src/isar/state_machine/state_machine.py
Original file line number Diff line number Diff line change
Expand Up @@ -516,7 +516,8 @@ def publish_mission_status(self) -> None:
self.mqtt_publisher.publish(
topic=settings.TOPIC_ISAR_MISSION,
payload=payload,
retain=False,
qos=1,
retain=True,
)

def publish_task_status(self, task: Task) -> None:
Expand Down Expand Up @@ -548,7 +549,8 @@ def publish_task_status(self, task: Task) -> None:
self.mqtt_publisher.publish(
topic=settings.TOPIC_ISAR_TASK,
payload=payload,
retain=False,
qos=1,
retain=True,
)

def publish_step_status(self, step: Step) -> None:
Expand Down Expand Up @@ -582,7 +584,8 @@ def publish_step_status(self, step: Step) -> None:
self.mqtt_publisher.publish(
topic=settings.TOPIC_ISAR_STEP,
payload=payload,
retain=False,
qos=1,
retain=True,
)

def publish_status(self) -> None:
Expand All @@ -601,7 +604,8 @@ def publish_status(self) -> None:
self.mqtt_publisher.publish(
topic=settings.TOPIC_ISAR_STATUS,
payload=payload,
retain=False,
qos=1,
retain=True,
)

def _current_status(self) -> RobotStatus:
Expand Down
3 changes: 2 additions & 1 deletion src/isar/storage/uploader.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,5 +161,6 @@ def _publish_inspection_result(
self.mqtt_publisher.publish(
topic=settings.TOPIC_ISAR_INSPECTION_RESULT,
payload=payload,
retain=False,
qos=1,
retain=True,
)