Mercurial > code > home > repos > homeauto
changeset 558:1df51216b712
mqtt lib wants to encode topic names
Ignore-this: 2b72670ac614943e7188419e1aba93b
author | drewp@bigasterisk.com |
---|---|
date | Wed, 01 May 2019 00:06:50 -0700 |
parents | 80f3cdc58224 |
children | 9294c00edbf7 |
files | lib/mqtt_client/mqtt_client.py |
diffstat | 1 files changed, 2 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/lib/mqtt_client/mqtt_client.py Wed May 01 00:03:23 2019 -0700 +++ b/lib/mqtt_client/mqtt_client.py Wed May 01 00:06:50 2019 -0700 @@ -78,10 +78,10 @@ self._resubscribe(topic) return ret - def _resubscribe(self, topic): + def _resubscribe(self, topic: bytes): log.info('subscribing %r', topic) self.serv.protocol.onPublish = self._onPublish - return self.serv.protocol.subscribe(topics=[(topic, 2)]) + return self.serv.protocol.subscribe(topics=[(topic.decode('utf-8'), 2)]) def _observe_msgs(self, observer): self.obs = observer