Skip to content

Commit e3f26a5

Browse files
andrewsayrejavache
andauthored
Release 0.7.4 (#40)
* Updated install URL and format * Bump 0.7.4 * Support gas meter capability and attributes (#39) Co-authored-by: Pieter De Baets <pieter.debaets@gmail.com>
1 parent 0c76c4f commit e3f26a5

File tree

11 files changed

+32
-17
lines changed

11 files changed

+32
-17
lines changed

.vscode/settings.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
{
2-
"python.pythonPath": ".venv\\Scripts\\python.exe",
32
"python.linting.pylintEnabled": true,
43
"python.linting.enabled": true,
54
"python.formatting.provider": "black",

pysmartthings/api.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
11
"""Utility for invoking the SmartThings Cloud API."""
22

3-
from typing import (
4-
Optional,
5-
Sequence,
6-
)
7-
83
from aiohttp import (
94
BasicAuth,
105
ClientSession,
116
)
7+
from typing import (
8+
Optional,
9+
Sequence,
10+
)
1211

1312
from .errors import (
1413
APIInvalidGrant,

pysmartthings/app.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
"""Define the app module."""
22

33
import re
4+
45
from typing import (
56
List,
67
Optional,

pysmartthings/capability.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,14 @@
4848
"filterStatus": ["filterStatus"],
4949
"formaldehydeMeasurement": ["formaldehydeLevel"],
5050
"garageDoorControl": ["door"],
51+
"gasMeter": [
52+
"gasMeter",
53+
"gasMeterCalorific",
54+
"gasMeterConversion",
55+
"gasMeterPrecision",
56+
"gasMeterTime",
57+
"gasMeterVolume",
58+
],
5159
"illuminanceMeasurement": ["illuminance"],
5260
"infraredLevel": ["infraredLevel"],
5361
"lock": ["lock"],
@@ -183,6 +191,12 @@ class Capability:
183191
filter_status = "filterStatus"
184192
formaldehyde_measurement = "formaldehydeMeasurement"
185193
garage_door_control = "garageDoorControl"
194+
gas_meter = "gasMeter"
195+
gas_meter_calorific = "gasMeterCalorific"
196+
gas_meter_conversion = "gasMeterConversion"
197+
gas_meter_precision = "gasMeterPrecision"
198+
gas_meter_time = "gasMeterTime"
199+
gas_meter_volume = "gasMeterVolume"
186200
illuminance_measurement = "illuminanceMeasurement"
187201
infrared_level = "infraredLevel"
188202
lock = "lock"
@@ -270,6 +284,7 @@ class Attribute:
270284
filter_status = "filterStatus"
271285
fine_dust_level = "fineDustLevel"
272286
formaldehyde_level = "formaldehydeLevel"
287+
gas_meter = "gasMeter"
273288
heating_setpoint = "heatingSetpoint"
274289
heating_setpoint_range = "heatingSetpointRange"
275290
hue = "hue"

pysmartthings/const.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
"""Define consts for the pysmartthings package."""
22

33
__title__ = "pysmartthings"
4-
__version__ = "0.7.3"
4+
__version__ = "0.7.4"

pysmartthings/device.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,9 @@
33
defaultdict,
44
namedtuple,
55
)
6-
import colorsys
76
import re
7+
8+
import colorsys
89
from typing import (
910
Any,
1011
Dict,

pysmartthings/errors.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
"""Define errors that can be returned from the SmartThings API."""
22
import json
3+
4+
from aiohttp import ClientResponseError
35
from typing import (
46
Optional,
57
Sequence,
68
)
79

8-
from aiohttp import ClientResponseError
9-
1010
UNAUTHORIZED_ERROR = (
1111
"Authorization for the API is required, but the request has not been "
1212
"authenticated."

pysmartthings/installedapp.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
def format_install_url(app_id: str, location_id: str) -> str:
1212
"""Return a web-based URL to auth and install a SmartApp."""
13-
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"
13+
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"
1414

1515

1616
class InstalledAppType(Enum):

pysmartthings/oauthtoken.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
datetime,
55
timedelta,
66
)
7+
78
from typing import (
89
List,
910
Optional,

pysmartthings/smartthings.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
11
"""Define the SmartThings Cloud API."""
22

3+
from aiohttp import ClientSession
34
from typing import (
45
List,
56
Optional,
67
Sequence,
78
)
89

9-
from aiohttp import ClientSession
10-
1110
from .api import Api
1211
from .app import (
1312
App,

0 commit comments

Comments
 (0)