Skip to content

Commit

Permalink
ignore helperbot
Browse files Browse the repository at this point in the history
  • Loading branch information
edenhaus committed Aug 20, 2022
1 parent 8d7fd6c commit 8abf7e0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
6 changes: 4 additions & 2 deletions bumper/mqtt/helper_bot.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@ def add_response(self, response: str | bytes) -> None:
self._event.set()


HELPER_BOT_CLIENT_ID = "helperbot@bumper/helperbot"


class HelperBot:
"""Helper bot, which converts commands from the rest api to mqtt ones."""

Expand All @@ -44,9 +47,8 @@ def __init__(self, host: str, port: int, timeout: float = 60):
)
self._host = host
self._port = port
self._client_id = "helperbot@bumper/helperbot"
self._timeout = timeout
self._client = Client(self._client_id)
self._client = Client(HELPER_BOT_CLIENT_ID)

# pylint: disable=unused-argument
async def _on_message(
Expand Down
3 changes: 2 additions & 1 deletion bumper/mqtt/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
client_get,
client_set_mqtt,
)
from bumper.mqtt.helper_bot import HELPER_BOT_CLIENT_ID
from bumper.mqtt.proxy import ProxyClient
from bumper.util import get_logger

Expand Down Expand Up @@ -282,7 +283,7 @@ async def on_broker_client_subscribed(
proxymodelog.info(
f"MQTT Proxy Mode - New MQTT Topic Subscription - Client: {client_id} - Topic: {topic}"
)
else:
elif client_id != HELPER_BOT_CLIENT_ID:
proxymodelog.warning(
f"MQTT Proxy Mode - No proxy client found! - Client: {client_id} - Topic: {topic}"
)
Expand Down

0 comments on commit 8abf7e0

Please sign in to comment.