Skip to content

Commit f4ee48d

Browse files
authored
Merge pull request #32 from samson0v/master
Fixed type hinting
2 parents ba20fff + 2d748dc commit f4ee48d

File tree

3 files changed

+9
-7
lines changed

3 files changed

+9
-7
lines changed

tb_rest_client/rest_client_base.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@
1414
# limitations under the License.
1515
#
1616

17-
from json import dumps
1817
from time import time, sleep
18+
from typing import List
1919

2020
from requests import post
2121
from threading import Thread

tb_rest_client/rest_client_ce.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
# limitations under the License.
1515
#
1616

17+
from typing import List
1718
from tb_rest_client.rest_client_base import *
1819

1920
logger = getLogger(__name__)
@@ -479,7 +480,7 @@ def set_tenant_home_dashboard_info(self, body: HomeDashboardInfo):
479480
def get_home_dashboard(self, ):
480481
return self.dashboard_controller.get_home_dashboard_using_get()
481482

482-
def add_dashboard_customers(self, body: list[str], dashboard_id: DashboardId):
483+
def add_dashboard_customers(self, body: List[str], dashboard_id: DashboardId):
483484
dashboard_id = self.get_id(dashboard_id)
484485
return self.dashboard_controller.add_dashboard_customers_using_post(body=body, dashboard_id=dashboard_id)
485486

@@ -520,7 +521,7 @@ def get_customer_dashboards(self, customer_id: CustomerId, page_size: str, page:
520521
customer_id = self.get_id(customer_id)
521522
return self.dashboard_controller.get_customer_dashboards_using_get(customer_id=customer_id, page_size=page_size, page=page, mobile=mobile, text_search=text_search, sort_property=sort_property, sort_order=sort_order)
522523

523-
def remove_dashboard_customers(self, body: list[str], dashboard_id: DashboardId):
524+
def remove_dashboard_customers(self, body: List[str], dashboard_id: DashboardId):
524525
dashboard_id = self.get_id(dashboard_id)
525526
return self.dashboard_controller.remove_dashboard_customers_using_post(body=body, dashboard_id=dashboard_id)
526527

tb_rest_client/rest_client_pe.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
# See the License for the specific language governing permissions and
1414
# limitations under the License.
1515
#
16+
from typing import List
1617

1718
from tb_rest_client.rest_client_base import *
1819

@@ -328,7 +329,7 @@ def get_user_group_permissions(self, user_group_id: EntityId):
328329
user_group_id = self.get_id(user_group_id)
329330
return self.group_permission_controller.get_user_group_permissions_using_get(user_group_id=user_group_id)
330331

331-
def load_user_group_permission_infos(self, body: list[GroupPermission]):
332+
def load_user_group_permission_infos(self, body: List[GroupPermission]):
332333
return self.group_permission_controller.load_user_group_permission_infos_using_post(body=body)
333334

334335
def save_group_permission(self, body: GroupPermission):
@@ -711,7 +712,7 @@ def get_group_dashboards(self, entity_group_id: EntityGroupId, page_size: str, p
711712
entity_group_id = self.get_id(entity_group_id)
712713
return self.dashboard_controller.get_group_dashboards_using_get(entity_group_id=entity_group_id, page_size=page_size, page=page, text_search=text_search, sort_property=sort_property, sort_order=sort_order)
713714

714-
def import_group_dashboards(self, body: list[Dashboard], entity_group_id: EntityGroupId, overwrite=None):
715+
def import_group_dashboards(self, body: List[Dashboard], entity_group_id: EntityGroupId, overwrite=None):
715716
entity_group_id = self.get_id(entity_group_id)
716717
return self.dashboard_controller.import_group_dashboards_using_post(body=body, entity_group_id=entity_group_id, overwrite=overwrite)
717718

@@ -949,7 +950,7 @@ def get_ota_packages(self, device_profile_id: DeviceProfileId, type: str, page_s
949950
def get_ota_packages_v1(self, page_size: int, page: int, text_search=None, sort_property=None, sort_order=None):
950951
return self.ota_package_controller.get_ota_packages_using_get1(page_size=page_size, page=page, text_search=text_search, sort_property=sort_property, sort_order=sort_order)
951952

952-
def add_entities_to_entity_group(self, body: list[str], entity_group_id: EntityGroupId):
953+
def add_entities_to_entity_group(self, body: List[str], entity_group_id: EntityGroupId):
953954
entity_group_id = self.get_id(entity_group_id)
954955
return self.entity_group_controller.add_entities_to_entity_group_using_post(body=body, entity_group_id=entity_group_id)
955956

@@ -1016,7 +1017,7 @@ def make_entity_group_public(self, entity_group_id: EntityGroupId):
10161017
entity_group_id = self.get_id(entity_group_id)
10171018
return self.entity_group_controller.make_entity_group_public_using_post(entity_group_id=entity_group_id)
10181019

1019-
def remove_entities_from_entity_group(self, body: list[str], entity_group_id: EntityGroupId):
1020+
def remove_entities_from_entity_group(self, body: List[str], entity_group_id: EntityGroupId):
10201021
entity_group_id = self.get_id(entity_group_id)
10211022
return self.entity_group_controller.remove_entities_from_entity_group_using_post(body=body, entity_group_id=entity_group_id)
10221023

0 commit comments

Comments
 (0)