diff --git a/.vscode/settings.json b/.vscode/settings.json index 2e9164d..6422c07 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,5 +1,4 @@ { - "python.pythonPath": ".venv\\Scripts\\python.exe", "python.linting.pylintEnabled": true, "python.linting.enabled": true, "python.formatting.provider": "black", diff --git a/pysmartthings/api.py b/pysmartthings/api.py index 5155dcb..40ee7d1 100644 --- a/pysmartthings/api.py +++ b/pysmartthings/api.py @@ -1,14 +1,13 @@ """Utility for invoking the SmartThings Cloud API.""" -from typing import ( - Optional, - Sequence, -) - from aiohttp import ( BasicAuth, ClientSession, ) +from typing import ( + Optional, + Sequence, +) from .errors import ( APIInvalidGrant, diff --git a/pysmartthings/app.py b/pysmartthings/app.py index d4e49fa..7417b81 100644 --- a/pysmartthings/app.py +++ b/pysmartthings/app.py @@ -1,6 +1,7 @@ """Define the app module.""" import re + from typing import ( List, Optional, diff --git a/pysmartthings/capability.py b/pysmartthings/capability.py index 155cc89..537fc7c 100644 --- a/pysmartthings/capability.py +++ b/pysmartthings/capability.py @@ -48,6 +48,14 @@ "filterStatus": ["filterStatus"], "formaldehydeMeasurement": ["formaldehydeLevel"], "garageDoorControl": ["door"], + "gasMeter": [ + "gasMeter", + "gasMeterCalorific", + "gasMeterConversion", + "gasMeterPrecision", + "gasMeterTime", + "gasMeterVolume", + ], "illuminanceMeasurement": ["illuminance"], "infraredLevel": ["infraredLevel"], "lock": ["lock"], @@ -183,6 +191,12 @@ class Capability: filter_status = "filterStatus" formaldehyde_measurement = "formaldehydeMeasurement" garage_door_control = "garageDoorControl" + gas_meter = "gasMeter" + gas_meter_calorific = "gasMeterCalorific" + gas_meter_conversion = "gasMeterConversion" + gas_meter_precision = "gasMeterPrecision" + gas_meter_time = "gasMeterTime" + gas_meter_volume = "gasMeterVolume" illuminance_measurement = "illuminanceMeasurement" infrared_level = "infraredLevel" lock = "lock" @@ -270,6 +284,7 @@ class Attribute: filter_status = "filterStatus" fine_dust_level = "fineDustLevel" formaldehyde_level = "formaldehydeLevel" + gas_meter = "gasMeter" heating_setpoint = "heatingSetpoint" heating_setpoint_range = "heatingSetpointRange" hue = "hue" diff --git a/pysmartthings/const.py b/pysmartthings/const.py index b144b92..d4f54e7 100644 --- a/pysmartthings/const.py +++ b/pysmartthings/const.py @@ -1,4 +1,4 @@ """Define consts for the pysmartthings package.""" __title__ = "pysmartthings" -__version__ = "0.7.3" +__version__ = "0.7.4" diff --git a/pysmartthings/device.py b/pysmartthings/device.py index b61bbc2..66656b6 100644 --- a/pysmartthings/device.py +++ b/pysmartthings/device.py @@ -3,8 +3,9 @@ defaultdict, namedtuple, ) -import colorsys import re + +import colorsys from typing import ( Any, Dict, diff --git a/pysmartthings/errors.py b/pysmartthings/errors.py index 63b5761..7cd3e9e 100644 --- a/pysmartthings/errors.py +++ b/pysmartthings/errors.py @@ -1,12 +1,12 @@ """Define errors that can be returned from the SmartThings API.""" import json + +from aiohttp import ClientResponseError from typing import ( Optional, Sequence, ) -from aiohttp import ClientResponseError - UNAUTHORIZED_ERROR = ( "Authorization for the API is required, but the request has not been " "authenticated." diff --git a/pysmartthings/installedapp.py b/pysmartthings/installedapp.py index afdc527..94523a5 100644 --- a/pysmartthings/installedapp.py +++ b/pysmartthings/installedapp.py @@ -10,7 +10,7 @@ def format_install_url(app_id: str, location_id: str) -> str: """Return a web-based URL to auth and install a SmartApp.""" - return f"https://account.smartthings.com/login?redirect=https%3A%2F%2Fstrongman-regional.api.smartthings.com%2F%3FappId%3D{app_id}%26locationId%3D{location_id}%26appType%3DENDPOINTAPP%26language%3Den%26clientOS%3Dweb%26theme%3Dsmartthings" + return f"https://account.smartthings.com/login?redirect=https%3A%2F%2Fstrongman-regional.api.smartthings.com%2F%3FappId%3D{app_id}%26locationId%3D{location_id}%26appType%3DENDPOINTAPP%26language%3Den%26clientOS%3Dweb" class InstalledAppType(Enum): diff --git a/pysmartthings/oauthtoken.py b/pysmartthings/oauthtoken.py index c626060..a6496bd 100644 --- a/pysmartthings/oauthtoken.py +++ b/pysmartthings/oauthtoken.py @@ -4,6 +4,7 @@ datetime, timedelta, ) + from typing import ( List, Optional, diff --git a/pysmartthings/smartthings.py b/pysmartthings/smartthings.py index 7f1990a..4070edc 100644 --- a/pysmartthings/smartthings.py +++ b/pysmartthings/smartthings.py @@ -1,13 +1,12 @@ """Define the SmartThings Cloud API.""" +from aiohttp import ClientSession from typing import ( List, Optional, Sequence, ) -from aiohttp import ClientSession - from .api import Api from .app import ( App, diff --git a/tests/utilities.py b/tests/utilities.py index b98f4ea..8248569 100644 --- a/tests/utilities.py +++ b/tests/utilities.py @@ -1,14 +1,14 @@ """Define testing utilities.""" import json as _json +from urllib.parse import parse_qs + +from aiohttp import ClientSession +from aiohttp.client_exceptions import ClientResponseError from typing import ( Optional, Sequence, Union, ) -from urllib.parse import parse_qs - -from aiohttp import ClientSession -from aiohttp.client_exceptions import ClientResponseError from yarl import URL BodyFixtureType = Optional[Union[str, list, dict]]