The class-level variable _subscribed_topics is used to track what we're interested in:
|
self._subscribed_topics: List[str] = [] |
In subscribe(), the subscription is noted in the class-level variable (nit: list(set(... to deduplicate):
|
for t, q in topics: |
|
if self.on_subscribe is not None: |
|
self.on_subscribe(self, self.user_data, t, q) |
|
self._subscribed_topics.append(t) |
In reconnect(), subscriptions are re-established... but lo, they don't have any way to know qos, so they can't re-subscribe with their original QoS.
|
if resub_topics and subscribed_topics: |
|
self.logger.debug("Attempting to resubscribe to previously subscribed topics.") |
|
self._subscribed_topics = [] |
|
while subscribed_topics: |
|
feed = subscribed_topics.pop() |
|
self.subscribe(feed) |
The class-level variable
_subscribed_topicsis used to track what we're interested in:Adafruit_CircuitPython_MiniMQTT/adafruit_minimqtt/adafruit_minimqtt.py
Line 244 in bf47a0e
In
subscribe(), the subscription is noted in the class-level variable (nit:list(set(...to deduplicate):Adafruit_CircuitPython_MiniMQTT/adafruit_minimqtt/adafruit_minimqtt.py
Lines 837 to 840 in bf47a0e
In
reconnect(), subscriptions are re-established... but lo, they don't have any way to knowqos, so they can't re-subscribe with their original QoS.Adafruit_CircuitPython_MiniMQTT/adafruit_minimqtt/adafruit_minimqtt.py
Lines 970 to 975 in bf47a0e