Skip to content

Commit b2dcced

Browse files
committed
Improvements
1 parent 0b0b3ea commit b2dcced

File tree

4 files changed

+9
-7
lines changed

4 files changed

+9
-7
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
# python_rest_client
2-
ThingsBoard REST client
1+
# ThingsBoard PE REST API client
2+
ThingsBoard PE REST API client

setup.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# coding: utf-8
22

33
"""
4-
ThingsBoard REST API
4+
ThingsBoard PE REST API
55
66
For instructions how to authorize requests please visit <a href='http://thingsboard.io/docs/reference/rest-api/'>REST API documentation page</a>. # noqa: E501
77
@@ -26,10 +26,10 @@
2626
setup(
2727
name=NAME,
2828
version=VERSION,
29-
description="ThingsBoard REST API",
29+
description="ThingsBoard PE REST API client",
3030
author_email="info@thingsboard.io",
3131
url="",
32-
keywords=["Swagger", "ThingsBoard REST API"],
32+
keywords=["IoT", "ThingsBoard", "ThingsBoard PE REST API client"],
3333
install_requires=REQUIRES,
3434
packages=find_packages(),
3535
include_package_data=True,

tb_rest_client_pe/api_client.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,12 +170,14 @@ def __call_api(
170170
# query parameters
171171
if query_params:
172172
query_params = self.sanitize_for_serialization(query_params)
173+
query_params = [param for param in query_params if (isinstance(param, tuple) and len(param) > 1 and param[1] is not None) or not isinstance(param, tuple)]
173174
query_params = self.parameters_to_tuples(query_params,
174175
collection_formats)
175176

176177
# post parameters
177178
if post_params or files:
178179
post_params = self.prepare_post_parameters(post_params, files)
180+
post_params = [param for param in post_params if (isinstance(param, tuple) and len(param) > 1 and param[1] is not None) or not isinstance(param, tuple)]
179181
post_params = self.sanitize_for_serialization(post_params)
180182
post_params = self.parameters_to_tuples(post_params,
181183
collection_formats)
@@ -247,7 +249,7 @@ def sanitize_for_serialization(self, obj):
247249
for sub_obj in obj]
248250
elif isinstance(obj, tuple):
249251
return tuple(self.sanitize_for_serialization(sub_obj)
250-
for sub_obj in obj if sub_obj is not None)
252+
for sub_obj in obj)
251253
elif isinstance(obj, (datetime.datetime, datetime.date)):
252254
return obj.isoformat()
253255

tb_rest_client_pe/rest_client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@ def get_audit_logs(self, page_size=10, page=0, text_search=None, sort_property=N
234234

235235
def get_activation_token(self, user_id: UserId):
236236
user_id = self.get_id(user_id)
237-
return self.user_controller.get_user_token_using_get(user_id)
237+
return self.user_controller.get_activation_token_using_get(user_id)
238238

239239
def get_user(self):
240240
return self.auth_controller.get_user_using_get()

0 commit comments

Comments
 (0)