Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
镜像
Eclipse Foundation
paho.mqtt.python
提交
b7022343
P
paho.mqtt.python
项目概览
镜像
/
Eclipse Foundation
/
paho.mqtt.python
大约 1 年 前同步成功
通知
2
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
paho.mqtt.python
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
b7022343
编写于
7月 21, 2021
作者:
H
Hildo Guillardi Júnior
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fix None comparation as PEP (Fix #584)
上级
0cc8581a
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
11 addition
and
11 deletion
+11
-11
src/paho/mqtt/client.py
src/paho/mqtt/client.py
+11
-11
未找到文件。
src/paho/mqtt/client.py
浏览文件 @
b7022343
...
...
@@ -548,10 +548,10 @@ class Client(object):
"""
if
protocol
==
MQTTv5
:
if
clean_session
!=
None
:
if
clean_session
is
not
None
:
raise
ValueError
(
'Clean session is not used for MQTT 5.0'
)
else
:
if
clean_session
==
None
:
if
clean_session
is
None
:
clean_session
=
True
if
not
clean_session
and
(
client_id
==
""
or
client_id
is
None
):
raise
ValueError
(
...
...
@@ -1467,7 +1467,7 @@ class Client(object):
if
qos
<
0
or
qos
>
2
:
raise
ValueError
(
'Invalid QoS level.'
)
if
self
.
_protocol
==
MQTTv5
:
if
options
==
None
:
if
options
is
None
:
# if no options are provided, use the QoS passed instead
options
=
SubscribeOptions
(
qos
=
qos
)
elif
qos
!=
0
:
...
...
@@ -2541,7 +2541,7 @@ class Client(object):
remaining_length
+=
2
if
self
.
_protocol
==
MQTTv5
:
if
properties
==
None
:
if
properties
is
None
:
packed_properties
=
b
'
\x00
'
else
:
packed_properties
=
properties
.
pack
()
...
...
@@ -2615,13 +2615,13 @@ class Client(object):
remaining_length
+=
2
+
len
(
self
.
_password
)
if
self
.
_protocol
==
MQTTv5
:
if
self
.
_connect_properties
==
None
:
if
self
.
_connect_properties
is
None
:
packed_connect_properties
=
b
'
\x00
'
else
:
packed_connect_properties
=
self
.
_connect_properties
.
pack
()
remaining_length
+=
len
(
packed_connect_properties
)
if
self
.
_will
:
if
self
.
_will_properties
==
None
:
if
self
.
_will_properties
is
None
:
packed_will_properties
=
b
'
\x00
'
else
:
packed_will_properties
=
self
.
_will_properties
.
pack
()
...
...
@@ -2703,11 +2703,11 @@ class Client(object):
packet
.
append
(
command
)
if
self
.
_protocol
==
MQTTv5
:
if
properties
!=
None
or
reasoncode
!=
None
:
if
reasoncode
==
None
:
if
properties
is
not
None
or
reasoncode
is
not
None
:
if
reasoncode
is
None
:
reasoncode
=
ReasonCodes
(
DISCONNECT
>>
4
,
identifier
=
0
)
remaining_length
+=
1
if
properties
!=
None
:
if
properties
is
not
None
:
packed_props
=
properties
.
pack
()
remaining_length
+=
len
(
packed_props
)
...
...
@@ -2724,7 +2724,7 @@ class Client(object):
def
_send_subscribe
(
self
,
dup
,
topics
,
properties
=
None
):
remaining_length
=
2
if
self
.
_protocol
==
MQTTv5
:
if
properties
==
None
:
if
properties
is
None
:
packed_subscribe_properties
=
b
'
\x00
'
else
:
packed_subscribe_properties
=
properties
.
pack
()
...
...
@@ -2761,7 +2761,7 @@ class Client(object):
def
_send_unsubscribe
(
self
,
dup
,
topics
,
properties
=
None
):
remaining_length
=
2
if
self
.
_protocol
==
MQTTv5
:
if
properties
==
None
:
if
properties
is
None
:
packed_unsubscribe_properties
=
b
'
\x00
'
else
:
packed_unsubscribe_properties
=
properties
.
pack
()
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录