Skip to content

Commit 8b75a30

Browse files
authored
Update CI configuration and dependencies (#41)
* Update CI * Change CI environment config * Update dependencies and lint
1 parent e3f26a5 commit 8b75a30

25 files changed

+73
-184
lines changed

.travis.yml

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,13 @@ language: python
22
matrix:
33
fast_finish: true
44
include:
5-
- python: '3.6'
6-
env: TOXENV=lint
7-
- python: '3.6'
8-
env: TOXENV=cov
9-
after_success: coveralls
10-
- python: '3.7'
11-
env: TOXENV=py37
12-
dist: xenial
5+
- python: "3.8"
6+
env: TOXENV=lint
7+
- python: "3.8"
8+
env: TOXENV=cov
9+
after_success: coveralls
10+
- python: "3.7"
11+
env: TOXENV=py37
1312
install: pip install -U tox coveralls
1413
script: tox
1514
deploy:
@@ -21,4 +20,4 @@ deploy:
2120
skip_existing: true
2221
on:
2322
tags: true
24-
condition: $TOXENV = lint
23+
condition: $TOXENV = lint

pysmartthings/__init__.py

Lines changed: 6 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,7 @@
2020
Attribute,
2121
Capability,
2222
)
23-
from .const import ( # noqa
24-
__title__,
25-
__version__,
26-
)
23+
from .const import __title__, __version__ # noqa
2724
from .device import (
2825
DEVICE_TYPE_DTH,
2926
DEVICE_TYPE_ENDPOINT_APP,
@@ -36,36 +33,19 @@
3633
DeviceStatus,
3734
DeviceStatusBase,
3835
)
39-
from .errors import (
40-
APIErrorDetail,
41-
APIInvalidGrant,
42-
APIResponseError,
43-
)
36+
from .errors import APIErrorDetail, APIInvalidGrant, APIResponseError
4437
from .installedapp import (
4538
InstalledApp,
4639
InstalledAppEntity,
4740
InstalledAppStatus,
4841
InstalledAppType,
4942
)
50-
from .location import (
51-
Location,
52-
LocationEntity,
53-
)
43+
from .location import Location, LocationEntity
5444
from .oauthtoken import OAuthToken
55-
from .room import (
56-
Room,
57-
RoomEntity,
58-
)
59-
from .scene import (
60-
Scene,
61-
SceneEntity,
62-
)
45+
from .room import Room, RoomEntity
46+
from .scene import Scene, SceneEntity
6347
from .smartthings import SmartThings
64-
from .subscription import (
65-
SourceType,
66-
Subscription,
67-
SubscriptionEntity,
68-
)
48+
from .subscription import SourceType, Subscription, SubscriptionEntity
6949

7050
__all__ = [
7151
# app

pysmartthings/api.py

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

3-
from aiohttp import (
4-
BasicAuth,
5-
ClientSession,
6-
)
7-
from typing import (
8-
Optional,
9-
Sequence,
10-
)
11-
12-
from .errors import (
13-
APIInvalidGrant,
14-
APIResponseError,
15-
)
3+
from typing import Optional, Sequence
4+
5+
from aiohttp import BasicAuth, ClientSession
6+
7+
from .errors import APIInvalidGrant, APIResponseError
168

179
API_OAUTH_TOKEN = "https://auth-global.api.smartthings.com/oauth/token"
1810
API_BASE = "https://api.smartthings.com/v1/"

pysmartthings/app.py

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

33
import re
4-
5-
from typing import (
6-
List,
7-
Optional,
8-
)
4+
from typing import List, Optional
95

106
from .api import Api
117
from .entity import Entity

pysmartthings/device.py

Lines changed: 4 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,11 @@
11
"""Defines a SmartThings device."""
2-
from collections import (
3-
defaultdict,
4-
namedtuple,
5-
)
6-
import re
7-
2+
from collections import defaultdict, namedtuple
83
import colorsys
9-
from typing import (
10-
Any,
11-
Dict,
12-
Mapping,
13-
Optional,
14-
Sequence,
15-
Tuple,
16-
)
4+
import re
5+
from typing import Any, Dict, Mapping, Optional, Sequence, Tuple
176

187
from .api import Api
19-
from .capability import (
20-
ATTRIBUTE_OFF_VALUES,
21-
ATTRIBUTE_ON_VALUES,
22-
Attribute,
23-
Capability,
24-
)
8+
from .capability import ATTRIBUTE_OFF_VALUES, ATTRIBUTE_ON_VALUES, Attribute, Capability
259
from .entity import Entity
2610

2711
DEVICE_TYPE_OCF = "OCF"

pysmartthings/errors.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,8 @@
11
"""Define errors that can be returned from the SmartThings API."""
22
import json
3+
from typing import Optional, Sequence
34

45
from aiohttp import ClientResponseError
5-
from typing import (
6-
Optional,
7-
Sequence,
8-
)
96

107
UNAUTHORIZED_ERROR = (
118
"Authorization for the API is required, but the request has not been "

pysmartthings/location.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
"""Define the SmartThing location."""
22

3-
from typing import (
4-
List,
5-
Optional,
6-
)
3+
from typing import List, Optional
74

85
from .api import Api
96
from .entity import Entity

pysmartthings/oauthtoken.py

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,7 @@
11
"""Define the oauth module."""
22

3-
from datetime import (
4-
datetime,
5-
timedelta,
6-
)
7-
8-
from typing import (
9-
List,
10-
Optional,
11-
)
3+
from datetime import datetime, timedelta
4+
from typing import List, Optional
125

136
from .api import Api
147

pysmartthings/room.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
"""Defines the rooms module."""
2-
from typing import (
3-
Dict,
4-
Optional,
5-
)
2+
from typing import Dict, Optional
63

74
from .api import Api
85
from .entity import Entity

pysmartthings/scene.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
"""Define the scene module."""
2-
from typing import (
3-
Dict,
4-
Optional,
5-
)
2+
from typing import Dict, Optional
63

74
from .api import Api
85
from .entity import Entity

0 commit comments

Comments
 (0)