switchbot-api 2.4.0__tar.gz → 2.6.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {switchbot_api-2.4.0 → switchbot_api-2.6.0}/PKG-INFO +21 -4
- {switchbot_api-2.4.0 → switchbot_api-2.6.0}/README.md +20 -3
- {switchbot_api-2.4.0 → switchbot_api-2.6.0}/pyproject.toml +1 -1
- {switchbot_api-2.4.0 → switchbot_api-2.6.0}/switchbot_api/__init__.py +121 -0
- {switchbot_api-2.4.0 → switchbot_api-2.6.0}/LICENSE +0 -0
- {switchbot_api-2.4.0 → switchbot_api-2.6.0}/switchbot_api/exceptions.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.3
|
|
2
2
|
Name: switchbot_api
|
|
3
|
-
Version: 2.
|
|
3
|
+
Version: 2.6.0
|
|
4
4
|
Summary: An asynchronous library to use Switchbot API
|
|
5
5
|
License: MIT
|
|
6
6
|
Author: Ravaka Razafimanantsoa
|
|
@@ -36,13 +36,30 @@ await client.send_command('some-id', {COMMAND})
|
|
|
36
36
|
### Install
|
|
37
37
|
|
|
38
38
|
```bash
|
|
39
|
-
|
|
39
|
+
make install
|
|
40
40
|
```
|
|
41
41
|
|
|
42
42
|
### Lint
|
|
43
43
|
|
|
44
44
|
```bash
|
|
45
|
-
|
|
46
|
-
|
|
45
|
+
make format
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
### Test
|
|
49
|
+
|
|
50
|
+
```bash
|
|
51
|
+
make test
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
### build wheel
|
|
55
|
+
|
|
56
|
+
```bash
|
|
57
|
+
make build
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
### Clean
|
|
61
|
+
|
|
62
|
+
```bash
|
|
63
|
+
make clean
|
|
47
64
|
```
|
|
48
65
|
|
|
@@ -18,12 +18,29 @@ await client.send_command('some-id', {COMMAND})
|
|
|
18
18
|
### Install
|
|
19
19
|
|
|
20
20
|
```bash
|
|
21
|
-
|
|
21
|
+
make install
|
|
22
22
|
```
|
|
23
23
|
|
|
24
24
|
### Lint
|
|
25
25
|
|
|
26
26
|
```bash
|
|
27
|
-
|
|
28
|
-
|
|
27
|
+
make format
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
### Test
|
|
31
|
+
|
|
32
|
+
```bash
|
|
33
|
+
make test
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
### build wheel
|
|
37
|
+
|
|
38
|
+
```bash
|
|
39
|
+
make build
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
### Clean
|
|
43
|
+
|
|
44
|
+
```bash
|
|
45
|
+
make clean
|
|
29
46
|
```
|
|
@@ -36,6 +36,8 @@ class Device:
|
|
|
36
36
|
device_name: str
|
|
37
37
|
device_type: str
|
|
38
38
|
hub_device_id: str
|
|
39
|
+
group: bool
|
|
40
|
+
master: bool | None
|
|
39
41
|
|
|
40
42
|
def __init__(self, **kwargs: Any) -> None:
|
|
41
43
|
"""Initialize."""
|
|
@@ -43,6 +45,8 @@ class Device:
|
|
|
43
45
|
self.device_name = kwargs["deviceName"]
|
|
44
46
|
self.device_type = kwargs.get("deviceType", "-")
|
|
45
47
|
self.hub_device_id = kwargs["hubDeviceId"]
|
|
48
|
+
self.group = kwargs.get("group", False)
|
|
49
|
+
self.master = kwargs.get("master")
|
|
46
50
|
|
|
47
51
|
|
|
48
52
|
@dataclass
|
|
@@ -78,6 +82,7 @@ class CommonCommands(Commands):
|
|
|
78
82
|
|
|
79
83
|
ON = "turnOn"
|
|
80
84
|
OFF = "turnOff"
|
|
85
|
+
TOGGLE = "toggle"
|
|
81
86
|
|
|
82
87
|
|
|
83
88
|
class OthersCommands(Commands):
|
|
@@ -102,6 +107,122 @@ class HumidifierCommands(Commands):
|
|
|
102
107
|
SET_MODE = "setMode"
|
|
103
108
|
|
|
104
109
|
|
|
110
|
+
class HumidifierV2Commands(Commands):
|
|
111
|
+
"""Humidifier 2 commands."""
|
|
112
|
+
|
|
113
|
+
SET_MODE = "setMode"
|
|
114
|
+
SET_CHILD_LOCK = "setChildLock"
|
|
115
|
+
|
|
116
|
+
|
|
117
|
+
class AirPurifierCommands(Commands):
|
|
118
|
+
"""Purifier commands."""
|
|
119
|
+
|
|
120
|
+
# Supported Device List:
|
|
121
|
+
# Air Purifier VOC
|
|
122
|
+
# Air Purifier Table VOC
|
|
123
|
+
# Air Purifier PM2.5
|
|
124
|
+
# Air Purifier Table PM2.5
|
|
125
|
+
|
|
126
|
+
SET_MODE = "setMode"
|
|
127
|
+
SET_CHILD_LOCK = "setChildLock"
|
|
128
|
+
|
|
129
|
+
|
|
130
|
+
class CurtainCommands(Commands):
|
|
131
|
+
"""Curtain & Curtain3 commands."""
|
|
132
|
+
|
|
133
|
+
SET_POSITION = "setPosition"
|
|
134
|
+
PAUSE = "pause"
|
|
135
|
+
|
|
136
|
+
|
|
137
|
+
class SwitchCommands(Commands):
|
|
138
|
+
"""Switch commands."""
|
|
139
|
+
|
|
140
|
+
# Supported Device List:
|
|
141
|
+
# Relay Switch 1
|
|
142
|
+
# Relay Switch 1PM
|
|
143
|
+
SET_MODE = "setMode"
|
|
144
|
+
|
|
145
|
+
|
|
146
|
+
class Switch2PMCommands(Commands):
|
|
147
|
+
"""Switch commands."""
|
|
148
|
+
|
|
149
|
+
# Supported Device List:
|
|
150
|
+
# Relay Switch 2PM
|
|
151
|
+
SET_MODE = "setMode"
|
|
152
|
+
SET_POSITION = "setPosition"
|
|
153
|
+
|
|
154
|
+
|
|
155
|
+
class RGBWLightCommands(Commands):
|
|
156
|
+
"""RGBWLight commands."""
|
|
157
|
+
|
|
158
|
+
# Supported Device List:
|
|
159
|
+
# Strip Light
|
|
160
|
+
SET_BRIGHTNESS = "setBrightness"
|
|
161
|
+
SET_COLOR = "setColor"
|
|
162
|
+
|
|
163
|
+
|
|
164
|
+
class RGBWWLightCommands(Commands):
|
|
165
|
+
"""RGBWwLight commands."""
|
|
166
|
+
|
|
167
|
+
# Supported Device List:
|
|
168
|
+
# Floor Lamp
|
|
169
|
+
# Strip Light 3
|
|
170
|
+
# Color Bulb
|
|
171
|
+
SET_BRIGHTNESS = "setBrightness"
|
|
172
|
+
SET_COLOR = "setColor"
|
|
173
|
+
SET_COLOR_TEMPERATURE = "setColorTemperature"
|
|
174
|
+
|
|
175
|
+
|
|
176
|
+
class DoorBellCommands(Commands):
|
|
177
|
+
"""Door Bell commands."""
|
|
178
|
+
|
|
179
|
+
ENABLE = "enableMotionDetection"
|
|
180
|
+
DISABLE = "disableMotionDetection"
|
|
181
|
+
|
|
182
|
+
|
|
183
|
+
class VacuumCleanerV2Commands(Commands):
|
|
184
|
+
"""VacuumCleanerV2 commands."""
|
|
185
|
+
|
|
186
|
+
# Supported Device List:
|
|
187
|
+
# K20+ Pro
|
|
188
|
+
# Robot Vacuum Cleaner K10+ Pro Combo
|
|
189
|
+
START_CLEAN = "startClean"
|
|
190
|
+
PAUSE = "pause"
|
|
191
|
+
DOCK = "dock"
|
|
192
|
+
SET_VOLUME = "setVolume"
|
|
193
|
+
CHANGE_PARAM = "changeParam"
|
|
194
|
+
|
|
195
|
+
|
|
196
|
+
class VacuumCleanerV3Commands(Commands):
|
|
197
|
+
"""VacuumCleanerV3 commands."""
|
|
198
|
+
|
|
199
|
+
# Supported Device List:
|
|
200
|
+
# Floor Cleaning Robot S10
|
|
201
|
+
# S20
|
|
202
|
+
START_CLEAN = "startClean"
|
|
203
|
+
PAUSE = "pause"
|
|
204
|
+
DOCK = "dock"
|
|
205
|
+
SET_VOLUME = "setVolume"
|
|
206
|
+
CHANGE_PARAM = "changeParam"
|
|
207
|
+
ADD_WATER_FOR_HUMI = "addWaterForHumi"
|
|
208
|
+
SELF_CLEAN = "selfClean"
|
|
209
|
+
|
|
210
|
+
|
|
211
|
+
class BlindTiltCommands(Commands):
|
|
212
|
+
"""Blind Tilt commands."""
|
|
213
|
+
|
|
214
|
+
SET_POSITION = "setPosition"
|
|
215
|
+
FULLY_OPEN = "fullyOpen"
|
|
216
|
+
CLOSE_UP = "closeUp"
|
|
217
|
+
CLOSE_DOWN = "closeDown"
|
|
218
|
+
|
|
219
|
+
|
|
220
|
+
class RollerShadeCommands(Commands):
|
|
221
|
+
"""Roller Shade commands."""
|
|
222
|
+
|
|
223
|
+
SET_POSITION = "setPosition"
|
|
224
|
+
|
|
225
|
+
|
|
105
226
|
class TVCommands(Commands):
|
|
106
227
|
"""TV commands."""
|
|
107
228
|
|
|
File without changes
|
|
File without changes
|