Skip to content

Commit

Permalink
Merge pull request #40 from frenck/frenck-2021-2637
Browse files Browse the repository at this point in the history
Fix Python >=3.7,<3.9 compatibility
  • Loading branch information
tsutsuku authored Oct 24, 2021
2 parents 01c8726 + 959a072 commit 56816b2
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 4 deletions.
3 changes: 1 addition & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ def requirements():
"Operating System :: OS Independent",
"Topic :: Software Development",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
Expand All @@ -44,5 +43,5 @@ def requirements():
test_suite="runtests.runtests",
entry_points={"nose.plugins": []},
packages=find_packages(),
python_requires=">=3.6",
python_requires=">=3.7",
)
1 change: 1 addition & 0 deletions tuya_iot/asset.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Tuya asset api."""
from __future__ import annotations

from typing import Any

Expand Down
3 changes: 3 additions & 0 deletions tuya_iot/device.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Tuya device api."""
from __future__ import annotations

import time
from abc import ABCMeta, abstractclassmethod
Expand Down Expand Up @@ -642,6 +643,8 @@ def get_device_stream_allocate(
return response["result"]["url"]
return None

def get_device_statistics_

def send_commands(
self, device_id: str, commands: list[dict[str, Any]]
) -> dict[str, Any]:
Expand Down
1 change: 1 addition & 0 deletions tuya_iot/home.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Tuya home's api base on asset and device api."""
from __future__ import annotations

from types import SimpleNamespace
from typing import Any
Expand Down
5 changes: 3 additions & 2 deletions tuya_iot/openapi.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
"""Tuya Open API."""

from __future__ import annotations

import hashlib
Expand Down Expand Up @@ -248,7 +247,9 @@ def __request(
headers["dev_channel"] = self.dev_channel

if self.token_info is not None:
refresh_token_api = TO_C_REFRESH_TOKEN_API.format(self.token_info.refresh_token)
refresh_token_api = TO_C_REFRESH_TOKEN_API.format(
self.token_info.refresh_token
)
if refresh_token_api == path:
headers["dev_lang"] = "python"
headers["dev_version"] = VERSION
Expand Down
1 change: 1 addition & 0 deletions tuya_iot/openlogging.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Tuya iot logging."""
from __future__ import annotations

import copy
import logging
Expand Down
1 change: 1 addition & 0 deletions tuya_iot/openmq.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Tuya Open IOT HUB which base on MQTT."""
from __future__ import annotations

import base64
import json
Expand Down

0 comments on commit 56816b2

Please sign in to comment.