Skip to content

Commit 1e24fa0

Browse files
authored
Update mqtt.py
Fixed endian for .to_bytes()
1 parent a71e986 commit 1e24fa0

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

examples/mqtt/mqtt.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ def subscribe(self, topic, qos=0):
136136
#print(hex(len(pkt)), hexlify(pkt, ":"))
137137
self.sock.write(pkt)
138138
self._send_str(topic)
139-
self.sock.write(qos.to_bytes(1))
139+
self.sock.write(qos.to_bytes(1, "little"))
140140
while 1:
141141
op = self.wait_msg()
142142
if op == 0x90:

0 commit comments

Comments
 (0)