Skip to content

Commit

Permalink
fix assertion in mqtt
Browse files Browse the repository at this point in the history
  • Loading branch information
pszafer committed Jan 26, 2025
1 parent 100ea2f commit 38ed23a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
8 changes: 6 additions & 2 deletions boneio/manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -778,13 +778,17 @@ async def receive_message(self, topic: str, message: str) -> None:
"""Callback for receiving action from Mqtt."""
_LOGGER.debug("Processing topic %s with message %s.", topic, message)
if topic.startswith(
f"{self._config_helper.topic_prefix}/status"
f"{self._config_helper.ha_discovery_prefix}/status"
):
if message == ONLINE:
self.resend_autodiscovery()
self._event_bus.signal_ha_online()
return
assert topic.startswith(self._config_helper.cmd_topic_prefix)
try:
assert topic.startswith(self._config_helper.cmd_topic_prefix)
except AssertionError as err:
_LOGGER.error("Wrong topic %s. Error %s", topic, err)
return
topic_parts_raw = topic[
len(self._config_helper.cmd_topic_prefix) :
].split("/")
Expand Down
2 changes: 1 addition & 1 deletion boneio/version.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
# flake8: noqa
__version__ = "0.9.4dev2"
__version__ = "0.9.4dev3"

0 comments on commit 38ed23a

Please sign in to comment.