Skip to content

Commit 1719008

Browse files
committed
Move TYPE_MODEL to constants and import
1 parent 6e4e4f2 commit 1719008

File tree

2 files changed

+13
-13
lines changed

2 files changed

+13
-13
lines changed

plugwise_usb/constants.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,3 +88,15 @@
8888
"070051": "Switch",
8989
"080029": "Switch",
9090
}
91+
92+
TYPE_MODEL: Final[dict[int, tuple[str]]] = {
93+
0: ("Stick"),
94+
1: ("Circle", "Stealth"),
95+
3: ("Switch"),
96+
4: (),
97+
5: ("Sense"),
98+
6: ("Scan"),
99+
7: ("Celsius"),
100+
8: ("Celcius"),
101+
9: ("Stealth"),
102+
}

plugwise_usb/nodes/node.py

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
RelayState,
2727
)
2828
from ..connection import StickController
29-
from ..constants import SUPPRESS_INITIALIZATION_WARNINGS, UTF8
29+
from ..constants import SUPPRESS_INITIALIZATION_WARNINGS, TYPE_MODEL, UTF8
3030
from ..exceptions import FeatureError, NodeError
3131
from ..helpers.util import version_to_model
3232
from ..messages.requests import NodeInfoRequest, NodePingRequest
@@ -49,18 +49,6 @@
4949
CACHE_HARDWARE = "hardware"
5050
CACHE_NODE_INFO_TIMESTAMP = "node_info_timestamp"
5151

52-
TYPE_MODEL: Final[dict[int, tuple[str]]] = {
53-
0: ("Stick"),
54-
1: ("Circle", "Stealth"),
55-
3: ("Switch"),
56-
4: (),
57-
5: ("Sense"),
58-
6: ("Scan"),
59-
7: ("Celsius"),
60-
8: ("Celcius"),
61-
9: ("Stealth"),
62-
}
63-
6452
class PlugwiseBaseNode(FeaturePublisher, ABC):
6553
"""Abstract Base Class for a Plugwise node."""
6654

0 commit comments

Comments
 (0)