diff --git a/boneio/manager.py b/boneio/manager.py index 1250bac..e2e7c99 100644 --- a/boneio/manager.py +++ b/boneio/manager.py @@ -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("/") diff --git a/boneio/version.py b/boneio/version.py index 7f0a47b..dea5ea0 100644 --- a/boneio/version.py +++ b/boneio/version.py @@ -1,2 +1,2 @@ # flake8: noqa -__version__ = "0.9.4dev2" +__version__ = "0.9.4dev3"