Update paho-mqtt==1.6.1

This commit is contained in:
JonnyWong16 2021-11-28 13:49:48 -08:00
parent d981f6e51f
commit 966a6696d1
No known key found for this signature in database
GPG key ID: B1F1F9807184697A
9 changed files with 680 additions and 502 deletions

View file

@ -3,7 +3,7 @@
Copyright (c) 2017, 2019 IBM Corp.
All rights reserved. This program and the accompanying materials
are made available under the terms of the Eclipse Public License v1.0
are made available under the terms of the Eclipse Public License v2.0
and Eclipse Distribution License v1.0 which accompany this distribution.
The Eclipse Public License is available at
@ -17,13 +17,14 @@
"""
import sys
from .packettypes import PacketTypes
class ReasonCodes:
"""MQTT version 5.0 reason codes class.
See ReasonCodes.names for a list of possible numeric values along with their
See ReasonCodes.names for a list of possible numeric values along with their
names and the packets to which they apply.
"""
@ -37,7 +38,7 @@ class ReasonCodes:
aName: the String name of the reason code to be created. Ignored
if the identifier is set.
identifier: an integer value of the reason code to be created.
identifier: an integer value of the reason code to be created.
"""
@ -120,7 +121,7 @@ class ReasonCodes:
}
if identifier == -1:
if packetType == PacketTypes.DISCONNECT and aName == "Success":
aName = "Normal disconnection"
aName = "Normal disconnection"
self.set(aName)
else:
self.value = identifier
@ -153,7 +154,7 @@ class ReasonCodes:
if self.packetType in self.names[code][name]:
identifier = code
break
assert identifier != None, name
assert identifier is not None, name
return identifier
def set(self, name):
@ -188,4 +189,4 @@ class ReasonCodes:
return self.getName()
def pack(self):
return bytearray([self.value])
return bytearray([self.value])