Mercurial > code > home > repos > homeauto
comparison lib/mqtt_client/mqtt_client.py @ 1387:8d165cd29a5b
don't send empty subscribe request at startup- broker will hang up on us
Ignore-this: 58121f8153070aeddc3c9957fd8d9006
darcs-hash:7e20eaf230ee8e65b96815576a893ee564489d27
author | drewp <drewp@bigasterisk.com> |
---|---|
date | Fri, 10 May 2019 02:09:23 -0700 |
parents | c887b1cc5e83 |
children | ef03d25cc815 |
comparison
equal
deleted
inserted
replaced
1386:4e161b451e56 | 1387:8d165cd29a5b |
---|---|
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 |