Mercurial > code > home > repos > homeauto
comparison lib/mqtt_client/mqtt_client.py @ 584:8fcd51b1cb00
don't send empty subscribe request at startup- broker will hang up on us
Ignore-this: 58121f8153070aeddc3c9957fd8d9006
author | drewp@bigasterisk.com |
---|---|
date | Fri, 10 May 2019 02:09:23 -0700 |
parents | 6b6a7d06691e |
children | 3d3ad50e2c51 |
comparison
equal
deleted
inserted
replaced
583:865dc66aa2c0 | 584:8fcd51b1cb00 |
---|---|
28 self.protocol.subscribe(topics=[(topic.decode('utf8'), 2)]) | 28 self.protocol.subscribe(topics=[(topic.decode('utf8'), 2)]) |
29 # else it'll get done in the next connectToBroker. | 29 # else it'll get done in the next connectToBroker. |
30 | 30 |
31 def _subscribeAll(self): | 31 def _subscribeAll(self): |
32 topics = list(self.observersByTopic) | 32 topics = list(self.observersByTopic) |
33 if not topics: | |
34 return | |
33 log.info('subscribing %r', topics) | 35 log.info('subscribing %r', topics) |
34 self.protocol.subscribe(topics=[(topic.decode('utf8'), 2) for topic in topics]) | 36 self.protocol.subscribe(topics=[(topic.decode('utf8'), 2) for topic in topics]) |
35 | 37 |
36 | 38 |
37 @inlineCallbacks | 39 @inlineCallbacks |