Skip to content
This repository has been archived by the owner on May 9, 2024. It is now read-only.

Commit

Permalink
Release 0.7.4 (#40)
Browse files Browse the repository at this point in the history
* Updated install URL and format

* Bump 0.7.4

* Support gas meter capability and attributes (#39)

Co-authored-by: Pieter De Baets <[email protected]>
  • Loading branch information
andrewsayre and javache committed Oct 5, 2020
1 parent 0c76c4f commit e3f26a5
Show file tree
Hide file tree
Showing 11 changed files with 32 additions and 17 deletions.
1 change: 0 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
{
"python.pythonPath": ".venv\\Scripts\\python.exe",
"python.linting.pylintEnabled": true,
"python.linting.enabled": true,
"python.formatting.provider": "black",
Expand Down
9 changes: 4 additions & 5 deletions pysmartthings/api.py
Original file line number Diff line number Diff line change
@@ -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,
Expand Down
1 change: 1 addition & 0 deletions pysmartthings/app.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""Define the app module."""

import re

from typing import (
List,
Optional,
Expand Down
15 changes: 15 additions & 0 deletions pysmartthings/capability.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,14 @@
"filterStatus": ["filterStatus"],
"formaldehydeMeasurement": ["formaldehydeLevel"],
"garageDoorControl": ["door"],
"gasMeter": [
"gasMeter",
"gasMeterCalorific",
"gasMeterConversion",
"gasMeterPrecision",
"gasMeterTime",
"gasMeterVolume",
],
"illuminanceMeasurement": ["illuminance"],
"infraredLevel": ["infraredLevel"],
"lock": ["lock"],
Expand Down Expand Up @@ -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"
Expand Down Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion pysmartthings/const.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"""Define consts for the pysmartthings package."""

__title__ = "pysmartthings"
__version__ = "0.7.3"
__version__ = "0.7.4"
3 changes: 2 additions & 1 deletion pysmartthings/device.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@
defaultdict,
namedtuple,
)
import colorsys
import re

import colorsys
from typing import (
Any,
Dict,
Expand Down
4 changes: 2 additions & 2 deletions pysmartthings/errors.py
Original file line number Diff line number Diff line change
@@ -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."
Expand Down
2 changes: 1 addition & 1 deletion pysmartthings/installedapp.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
1 change: 1 addition & 0 deletions pysmartthings/oauthtoken.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
datetime,
timedelta,
)

from typing import (
List,
Optional,
Expand Down
3 changes: 1 addition & 2 deletions pysmartthings/smartthings.py
Original file line number Diff line number Diff line change
@@ -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,
Expand Down
8 changes: 4 additions & 4 deletions tests/utilities.py
Original file line number Diff line number Diff line change
@@ -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]]
Expand Down

0 comments on commit e3f26a5

Please sign in to comment.