1818from aiomqtt import MqttCodeError , MqttError , TLSParameters
1919
2020from roborock .callbacks import CallbackMap
21- from roborock .diagnostics import Diagnostics
21+ from roborock .diagnostics import Diagnostics , redact_topic_name
2222
2323from .health_manager import HealthManager
2424from .session import MqttParams , MqttSession , MqttSessionException , MqttSessionUnauthorized
@@ -241,7 +241,7 @@ async def _mqtt_client(self, params: MqttParams) -> aiomqtt.Client:
241241 self ._client = client
242242 for topic in self ._client_subscribed_topics :
243243 self ._diagnostics .increment ("resubscribe" )
244- _LOGGER .debug ("Re-establishing subscription to topic %s" , topic )
244+ _LOGGER .debug ("Re-establishing subscription to topic %s" , redact_topic_name ( topic ) )
245245 # TODO: If this fails it will break the whole connection. Make
246246 # this retry again in the background with backoff.
247247 await client .subscribe (topic )
@@ -261,13 +261,13 @@ async def subscribe(self, topic: str, callback: Callable[[bytes], None]) -> Call
261261 unsubscription for the idle timeout period. If a new subscription comes in during the
262262 timeout, the timer is cancelled and the subscription is reused.
263263 """
264- _LOGGER .debug ("Subscribing to topic %s" , topic )
264+ _LOGGER .debug ("Subscribing to topic %s" , redact_topic_name ( topic ) )
265265
266266 # If there is an idle timer for this topic, cancel it (reuse subscription)
267267 if idle_timer := self ._idle_timers .pop (topic , None ):
268268 self ._diagnostics .increment ("unsubscribe_idle_cancel" )
269269 idle_timer .cancel ()
270- _LOGGER .debug ("Cancelled idle timer for topic %s (reused subscription)" , topic )
270+ _LOGGER .debug ("Cancelled idle timer for topic %s (reused subscription)" , redact_topic_name ( topic ) )
271271
272272 unsub = self ._listeners .add_callback (topic , callback )
273273
0 commit comments