Skip to content

Commit 9760350

Browse files
authored
Extract capabilities, attributes and commands in own file (#150)
1 parent 223eab1 commit 9760350

File tree

11 files changed

+2473
-2457
lines changed

11 files changed

+2473
-2457
lines changed

script/process_device_status.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
import re
66
import sys
77

8-
from pysmartthings.models import CAPABILITY_ATTRIBUTES, Attribute, Capability
8+
from pysmartthings import CAPABILITY_ATTRIBUTES, Attribute, Capability
99
from treelib import Tree
1010

1111

@@ -22,7 +22,7 @@ def main() -> int: # noqa: PLR0912
2222
tree = Tree()
2323
found_capabilities = {}
2424
found_attributes = {}
25-
missing_attribute_mapping = {}
25+
missing_attribute_mapping: dict[str, list[str]] = {}
2626
tree.create_node(filename, "root")
2727
for component_name, capabilities in components.items(): # pylint: disable=too-many-nested-blocks
2828
tree.create_node(component_name, component_name, parent="root")

script/sort_attribute.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
"""Sort the Attribute enum."""
22

33
import pyperclip
4-
from pysmartthings.models import Attribute
4+
from pysmartthings import Attribute
55

66

77
def main() -> int:

script/sort_capability.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
"""Script to sort the capability constants."""
22

33
import pyperclip
4-
from pysmartthings.models import Capability
4+
from pysmartthings import Capability
55

66

77
def main() -> int:
88
"""Run the script."""
99
capabilities = {}
10-
dot_capabilities = {}
10+
dot_capabilities: dict[str, dict[str, Capability]] = {}
1111
for capability in Capability:
1212
if "." in capability.value:
1313
category = capability.value.split(".")[0]

script/sort_command.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
"""Sort the Command enum."""
22

33
import pyperclip
4-
from pysmartthings.models import Command
4+
from pysmartthings import Command
55

66

77
def main() -> int:

src/pysmartthings/__init__.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
"""A python library for interacting with the SmartThings cloud API."""
22

3+
from .attribute import CAPABILITY_ATTRIBUTES, Attribute
4+
from .capability import Capability
5+
from .command import CAPABILITY_COMMANDS, Command
36
from .exceptions import (
47
SmartThingsAuthenticationFailedError,
58
SmartThingsCommandError,
@@ -9,13 +12,8 @@
912
SmartThingsRateLimitError,
1013
)
1114
from .models import (
12-
CAPABILITY_ATTRIBUTES,
13-
CAPABILITY_COMMANDS,
14-
Attribute,
1515
BaseLocation,
16-
Capability,
1716
Category,
18-
Command,
1917
Component,
2018
Device,
2119
DeviceNetworkType,

0 commit comments

Comments
 (0)