Skip to content

Commit

Permalink
Expose loop_start and loop_end
Browse files Browse the repository at this point in the history
  • Loading branch information
Prior99 committed Sep 17, 2024
1 parent 3b27d57 commit b831f67
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions myskoda/mqtt.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,14 @@ def loop_forever(self) -> None:
"""Make the MQTT client process new messages until the current process is cancelled."""
self.client.loop_forever()

def loop_start(self) -> None:
"""Make the MQTT client process new messages in a thread in the background."""
self.client.loop_start()

def loop_stop(self) -> None:
"""Stop the thread for processing MQTT messages."""
self.client.loop_stop()

def _on_connect(self, client: Client, _data: None, _flags: dict, _reason: int) -> None:
_LOGGER.info("MQTT Connected.")
user_id = self.user.id
Expand Down

0 comments on commit b831f67

Please sign in to comment.