pyvesync 3.5.0__tar.gz → 3.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.
- {pyvesync-3.5.0/src/pyvesync.egg-info → pyvesync-3.6.0}/PKG-INFO +13 -7
- {pyvesync-3.5.0 → pyvesync-3.6.0}/README.md +10 -4
- {pyvesync-3.5.0 → pyvesync-3.6.0}/pyproject.toml +3 -3
- {pyvesync-3.5.0 → pyvesync-3.6.0}/src/pyvesync/auth.py +13 -3
- {pyvesync-3.5.0 → pyvesync-3.6.0}/src/pyvesync/base_devices/fryer_base.py +94 -14
- {pyvesync-3.5.0 → pyvesync-3.6.0}/src/pyvesync/base_devices/purifier_base.py +415 -1
- {pyvesync-3.5.0 → pyvesync-3.6.0}/src/pyvesync/const.py +237 -14
- {pyvesync-3.5.0 → pyvesync-3.6.0}/src/pyvesync/device_container.py +2 -2
- {pyvesync-3.5.0 → pyvesync-3.6.0}/src/pyvesync/device_map.py +430 -26
- {pyvesync-3.5.0 → pyvesync-3.6.0}/src/pyvesync/devices/vesynchumidifier.py +7 -1
- {pyvesync-3.5.0 → pyvesync-3.6.0}/src/pyvesync/devices/vesynckitchen.py +369 -67
- {pyvesync-3.5.0 → pyvesync-3.6.0}/src/pyvesync/devices/vesyncoutlet.py +276 -39
- pyvesync-3.6.0/src/pyvesync/devices/vesyncpurifier.py +2320 -0
- {pyvesync-3.5.0 → pyvesync-3.6.0}/src/pyvesync/models/bypass_models.py +11 -0
- {pyvesync-3.5.0 → pyvesync-3.6.0}/src/pyvesync/models/fryer_models.py +6 -0
- {pyvesync-3.5.0 → pyvesync-3.6.0}/src/pyvesync/models/outlet_models.py +75 -1
- {pyvesync-3.5.0 → pyvesync-3.6.0}/src/pyvesync/models/purifier_models.py +150 -3
- {pyvesync-3.5.0 → pyvesync-3.6.0}/src/pyvesync/utils/errors.py +11 -2
- {pyvesync-3.5.0 → pyvesync-3.6.0}/src/pyvesync/utils/helpers.py +15 -7
- {pyvesync-3.5.0 → pyvesync-3.6.0}/src/pyvesync/utils/logs.py +25 -1
- {pyvesync-3.5.0 → pyvesync-3.6.0}/src/pyvesync/vesync.py +258 -80
- {pyvesync-3.5.0 → pyvesync-3.6.0/src/pyvesync.egg-info}/PKG-INFO +13 -7
- {pyvesync-3.5.0 → pyvesync-3.6.0}/src/pyvesync.egg-info/requires.txt +2 -2
- pyvesync-3.5.0/src/pyvesync/devices/vesyncpurifier.py +0 -1131
- {pyvesync-3.5.0 → pyvesync-3.6.0}/LICENSE +0 -0
- {pyvesync-3.5.0 → pyvesync-3.6.0}/MANIFEST.in +0 -0
- {pyvesync-3.5.0 → pyvesync-3.6.0}/requirements.txt +0 -0
- {pyvesync-3.5.0 → pyvesync-3.6.0}/setup.cfg +0 -0
- {pyvesync-3.5.0 → pyvesync-3.6.0}/setup.py +0 -0
- {pyvesync-3.5.0 → pyvesync-3.6.0}/src/pyvesync/__init__.py +0 -0
- {pyvesync-3.5.0 → pyvesync-3.6.0}/src/pyvesync/base_devices/__init__.py +0 -0
- {pyvesync-3.5.0 → pyvesync-3.6.0}/src/pyvesync/base_devices/bulb_base.py +0 -0
- {pyvesync-3.5.0 → pyvesync-3.6.0}/src/pyvesync/base_devices/fan_base.py +0 -0
- {pyvesync-3.5.0 → pyvesync-3.6.0}/src/pyvesync/base_devices/humidifier_base.py +0 -0
- {pyvesync-3.5.0 → pyvesync-3.6.0}/src/pyvesync/base_devices/outlet_base.py +0 -0
- {pyvesync-3.5.0 → pyvesync-3.6.0}/src/pyvesync/base_devices/switch_base.py +0 -0
- {pyvesync-3.5.0 → pyvesync-3.6.0}/src/pyvesync/base_devices/thermostat_base.py +0 -0
- {pyvesync-3.5.0 → pyvesync-3.6.0}/src/pyvesync/base_devices/vesyncbasedevice.py +0 -0
- {pyvesync-3.5.0 → pyvesync-3.6.0}/src/pyvesync/devices/__init__.py +0 -0
- {pyvesync-3.5.0 → pyvesync-3.6.0}/src/pyvesync/devices/vesyncbulb.py +0 -0
- {pyvesync-3.5.0 → pyvesync-3.6.0}/src/pyvesync/devices/vesyncfan.py +0 -0
- {pyvesync-3.5.0 → pyvesync-3.6.0}/src/pyvesync/devices/vesyncswitch.py +0 -0
- {pyvesync-3.5.0 → pyvesync-3.6.0}/src/pyvesync/devices/vesyncthermostat.py +0 -0
- {pyvesync-3.5.0 → pyvesync-3.6.0}/src/pyvesync/models/__init__.py +0 -0
- {pyvesync-3.5.0 → pyvesync-3.6.0}/src/pyvesync/models/base_models.py +0 -0
- {pyvesync-3.5.0 → pyvesync-3.6.0}/src/pyvesync/models/bulb_models.py +0 -0
- {pyvesync-3.5.0 → pyvesync-3.6.0}/src/pyvesync/models/fan_models.py +0 -0
- {pyvesync-3.5.0 → pyvesync-3.6.0}/src/pyvesync/models/home_models.py +0 -0
- {pyvesync-3.5.0 → pyvesync-3.6.0}/src/pyvesync/models/humidifier_models.py +0 -0
- {pyvesync-3.5.0 → pyvesync-3.6.0}/src/pyvesync/models/switch_models.py +0 -0
- {pyvesync-3.5.0 → pyvesync-3.6.0}/src/pyvesync/models/thermostat_models.py +0 -0
- {pyvesync-3.5.0 → pyvesync-3.6.0}/src/pyvesync/models/vesync_models.py +0 -0
- {pyvesync-3.5.0 → pyvesync-3.6.0}/src/pyvesync/py.typed +0 -0
- {pyvesync-3.5.0 → pyvesync-3.6.0}/src/pyvesync/utils/__init__.py +0 -0
- {pyvesync-3.5.0 → pyvesync-3.6.0}/src/pyvesync/utils/colors.py +0 -0
- {pyvesync-3.5.0 → pyvesync-3.6.0}/src/pyvesync/utils/device_mixins.py +0 -0
- {pyvesync-3.5.0 → pyvesync-3.6.0}/src/pyvesync/utils/enum_utils.py +0 -0
- {pyvesync-3.5.0 → pyvesync-3.6.0}/src/pyvesync/vesynchome.py +0 -0
- {pyvesync-3.5.0 → pyvesync-3.6.0}/src/pyvesync.egg-info/SOURCES.txt +0 -0
- {pyvesync-3.5.0 → pyvesync-3.6.0}/src/pyvesync.egg-info/dependency_links.txt +0 -0
- {pyvesync-3.5.0 → pyvesync-3.6.0}/src/pyvesync.egg-info/top_level.txt +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: pyvesync
|
|
3
|
-
Version: 3.
|
|
3
|
+
Version: 3.6.0
|
|
4
4
|
Summary: pyvesync is a library to manage Etekcity Devices, Cosori Air Fryers, and Levoit Air Purifiers run on the VeSync app.
|
|
5
5
|
Author: Mark Perdue
|
|
6
6
|
Author-email: Joe Trabulsy <webdjoe@gmail.com>
|
|
@@ -23,7 +23,7 @@ Requires-Dist: pytest-cov; extra == "dev"
|
|
|
23
23
|
Requires-Dist: pyyaml; extra == "dev"
|
|
24
24
|
Requires-Dist: pylint; extra == "dev"
|
|
25
25
|
Requires-Dist: mypy; extra == "dev"
|
|
26
|
-
Requires-Dist: ruff==0.
|
|
26
|
+
Requires-Dist: ruff==0.17.6; extra == "dev"
|
|
27
27
|
Requires-Dist: pre-commit; extra == "dev"
|
|
28
28
|
Requires-Dist: tox; extra == "dev"
|
|
29
29
|
Requires-Dist: requests; extra == "dev"
|
|
@@ -31,7 +31,7 @@ Requires-Dist: aiofiles; extra == "dev"
|
|
|
31
31
|
Provides-Extra: docs
|
|
32
32
|
Requires-Dist: mkdocstrings-python; extra == "docs"
|
|
33
33
|
Requires-Dist: mkdocs; extra == "docs"
|
|
34
|
-
Requires-Dist: ruff==0.
|
|
34
|
+
Requires-Dist: ruff==0.17.6; extra == "docs"
|
|
35
35
|
Requires-Dist: Pygments; extra == "docs"
|
|
36
36
|
Requires-Dist: mkdocs-material; extra == "docs"
|
|
37
37
|
Requires-Dist: mkdocstrings; extra == "docs"
|
|
@@ -260,9 +260,10 @@ pip install pyvesync
|
|
|
260
260
|
4. Voltson Smart WiFi Outlet - Round (10A model ESW10-USA)
|
|
261
261
|
5. Voltson Smart WiFi Outlet - Rectangle (15A model ESW15-USA)
|
|
262
262
|
6. Two Plug Outdoor Outlet (ESO15-TB) (Each plug is a separate `VeSyncOutlet` object, energy readings are for both plugs combined)
|
|
263
|
-
7. BSDOG / Greensun Smart Outlet Series (BSDOG01, BSDOG02, WYSMTOD16A, WM-PLUG and more)
|
|
264
|
-
8. WHOGPLUG / Greensun Smart Plug
|
|
265
|
-
9. WYLDR Smart Plug (WYLDR16A1081)
|
|
263
|
+
7. BSDOG / Greensun Smart Outlet Series (BSDOG01, BSDOG02, WYSMTOD16A, WM-PLUG and more). A BSDOG02 on config module `BS_WFBO_OTL_BSDOG02_UN` uses the WHOG class.
|
|
264
|
+
8. WHOGPLUG / Greensun Smart Plug (WHOGPLUG, WYZYOGMINIPLUG, WYZYOG-HWPLUG16A). A WHOGPLUG on config module `WH_WFBO_OTL_S_WHOGPLUG_UN` uses the BSDOG class.
|
|
265
|
+
9. WYLDR Smart Plug (WYLDR16A1080, WYLDR16A1081)
|
|
266
|
+
10. Sagewe 15A Smart Plug with Energy Monitoring (F3s202-USVC)
|
|
266
267
|
|
|
267
268
|
<!--SUPPORTED OUTLETS END-->
|
|
268
269
|
|
|
@@ -287,6 +288,10 @@ pip install pyvesync
|
|
|
287
288
|
7. Vital 100S / 200S
|
|
288
289
|
8. Everest Air
|
|
289
290
|
9. Sprout Air Purifier
|
|
291
|
+
10. Vital Pet Pro (LAP-P501S)
|
|
292
|
+
11. Vital Pet (LAP-P201S-WUS)
|
|
293
|
+
12. Core 300S MaxAQ / Eleva 300X (LAP-C341S)
|
|
294
|
+
13. Eleva 500X (LAP-C511S)
|
|
290
295
|
|
|
291
296
|
### Etekcity / Valceno Bulbs
|
|
292
297
|
|
|
@@ -319,6 +324,7 @@ pip install pyvesync
|
|
|
319
324
|
4. Cosori Dual Blaze 6.8 Quart Air Fryer (CAF-P583S)
|
|
320
325
|
5. Cosori Dual Air Fryer (CAF-TF101S)
|
|
321
326
|
6. Cosori Turbo Tower Pro Smart Air Fryer (CAF-DC111S-AEU)
|
|
327
|
+
7. Cosori Smart 5.8 Quart Air Fryer (CS358-AF)
|
|
322
328
|
|
|
323
329
|
### Thermostats
|
|
324
330
|
|
|
@@ -523,7 +529,7 @@ if __name__ == "__main__":
|
|
|
523
529
|
Contributions — from humans and AI coding assistants alike — must follow three rules. These keep the library correct and maintainable. See the [contributing guide](https://webdjoe.github.io/pyvesync/latest/development/contributing) for full detail.
|
|
524
530
|
|
|
525
531
|
1. **Follow the intended architecture.** New devices are added through the three-tier hierarchy (base class → concrete device + API mixin → device map), with state in the device's `DeviceState` subclass, models in `models/`, and constants in `pyvesync.const`. API request/response shapes must come from a real packet capture — never invented.
|
|
526
|
-
2. **Verify on real hardware before merge.** New device support and any change to device behavior must be tested on the physical device, and the pull request must state the model
|
|
532
|
+
2. **Verify on real hardware before merge.** New device support and any change to device behavior must be tested on the physical device, and the pull request must state the model tested. Testing only through Home Assistant does not count.
|
|
527
533
|
3. **One change per pull request.** Each PR must be a single feature, fix, or edit. Large or mixed PRs that bundle unrelated changes will be asked to be broken up before review.
|
|
528
534
|
|
|
529
535
|
> **Using an AI assistant?** Agent instructions live in [`AGENTS.md`](AGENTS.md), which Codex and most tools read directly; [`CLAUDE.md`](CLAUDE.md) imports it for Claude Code. Point your assistant at it and the [contributing guide](https://webdjoe.github.io/pyvesync/latest/development/contributing). You are responsible for the result: it must follow the architecture, must not fabricate API fields, must not be submitted without real-device testing, and must be a single focused change.
|
|
@@ -212,9 +212,10 @@ pip install pyvesync
|
|
|
212
212
|
4. Voltson Smart WiFi Outlet - Round (10A model ESW10-USA)
|
|
213
213
|
5. Voltson Smart WiFi Outlet - Rectangle (15A model ESW15-USA)
|
|
214
214
|
6. Two Plug Outdoor Outlet (ESO15-TB) (Each plug is a separate `VeSyncOutlet` object, energy readings are for both plugs combined)
|
|
215
|
-
7. BSDOG / Greensun Smart Outlet Series (BSDOG01, BSDOG02, WYSMTOD16A, WM-PLUG and more)
|
|
216
|
-
8. WHOGPLUG / Greensun Smart Plug
|
|
217
|
-
9. WYLDR Smart Plug (WYLDR16A1081)
|
|
215
|
+
7. BSDOG / Greensun Smart Outlet Series (BSDOG01, BSDOG02, WYSMTOD16A, WM-PLUG and more). A BSDOG02 on config module `BS_WFBO_OTL_BSDOG02_UN` uses the WHOG class.
|
|
216
|
+
8. WHOGPLUG / Greensun Smart Plug (WHOGPLUG, WYZYOGMINIPLUG, WYZYOG-HWPLUG16A). A WHOGPLUG on config module `WH_WFBO_OTL_S_WHOGPLUG_UN` uses the BSDOG class.
|
|
217
|
+
9. WYLDR Smart Plug (WYLDR16A1080, WYLDR16A1081)
|
|
218
|
+
10. Sagewe 15A Smart Plug with Energy Monitoring (F3s202-USVC)
|
|
218
219
|
|
|
219
220
|
<!--SUPPORTED OUTLETS END-->
|
|
220
221
|
|
|
@@ -239,6 +240,10 @@ pip install pyvesync
|
|
|
239
240
|
7. Vital 100S / 200S
|
|
240
241
|
8. Everest Air
|
|
241
242
|
9. Sprout Air Purifier
|
|
243
|
+
10. Vital Pet Pro (LAP-P501S)
|
|
244
|
+
11. Vital Pet (LAP-P201S-WUS)
|
|
245
|
+
12. Core 300S MaxAQ / Eleva 300X (LAP-C341S)
|
|
246
|
+
13. Eleva 500X (LAP-C511S)
|
|
242
247
|
|
|
243
248
|
### Etekcity / Valceno Bulbs
|
|
244
249
|
|
|
@@ -271,6 +276,7 @@ pip install pyvesync
|
|
|
271
276
|
4. Cosori Dual Blaze 6.8 Quart Air Fryer (CAF-P583S)
|
|
272
277
|
5. Cosori Dual Air Fryer (CAF-TF101S)
|
|
273
278
|
6. Cosori Turbo Tower Pro Smart Air Fryer (CAF-DC111S-AEU)
|
|
279
|
+
7. Cosori Smart 5.8 Quart Air Fryer (CS358-AF)
|
|
274
280
|
|
|
275
281
|
### Thermostats
|
|
276
282
|
|
|
@@ -475,7 +481,7 @@ if __name__ == "__main__":
|
|
|
475
481
|
Contributions — from humans and AI coding assistants alike — must follow three rules. These keep the library correct and maintainable. See the [contributing guide](https://webdjoe.github.io/pyvesync/latest/development/contributing) for full detail.
|
|
476
482
|
|
|
477
483
|
1. **Follow the intended architecture.** New devices are added through the three-tier hierarchy (base class → concrete device + API mixin → device map), with state in the device's `DeviceState` subclass, models in `models/`, and constants in `pyvesync.const`. API request/response shapes must come from a real packet capture — never invented.
|
|
478
|
-
2. **Verify on real hardware before merge.** New device support and any change to device behavior must be tested on the physical device, and the pull request must state the model
|
|
484
|
+
2. **Verify on real hardware before merge.** New device support and any change to device behavior must be tested on the physical device, and the pull request must state the model tested. Testing only through Home Assistant does not count.
|
|
479
485
|
3. **One change per pull request.** Each PR must be a single feature, fix, or edit. Large or mixed PRs that bundle unrelated changes will be asked to be broken up before review.
|
|
480
486
|
|
|
481
487
|
> **Using an AI assistant?** Agent instructions live in [`AGENTS.md`](AGENTS.md), which Codex and most tools read directly; [`CLAUDE.md`](CLAUDE.md) imports it for Claude Code. Point your assistant at it and the [contributing guide](https://webdjoe.github.io/pyvesync/latest/development/contributing). You are responsible for the result: it must follow the architecture, must not fabricate API fields, must not be submitted without real-device testing, and must be a single focused change.
|
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "pyvesync"
|
|
7
|
-
version = "3.
|
|
7
|
+
version = "3.6.0"
|
|
8
8
|
description = "pyvesync is a library to manage Etekcity Devices, Cosori Air Fryers, and Levoit Air Purifiers run on the VeSync app."
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
requires-python = ">=3.11"
|
|
@@ -36,7 +36,7 @@ dev = [
|
|
|
36
36
|
"pyyaml",
|
|
37
37
|
"pylint",
|
|
38
38
|
"mypy",
|
|
39
|
-
"ruff==0.
|
|
39
|
+
"ruff==0.17.6",
|
|
40
40
|
"pre-commit",
|
|
41
41
|
"tox",
|
|
42
42
|
"requests",
|
|
@@ -45,7 +45,7 @@ dev = [
|
|
|
45
45
|
docs = [
|
|
46
46
|
"mkdocstrings-python",
|
|
47
47
|
"mkdocs",
|
|
48
|
-
"ruff==0.
|
|
48
|
+
"ruff==0.17.6",
|
|
49
49
|
"Pygments",
|
|
50
50
|
"mkdocs-material",
|
|
51
51
|
"mkdocstrings",
|
|
@@ -25,6 +25,7 @@ from pyvesync.utils.errors import (
|
|
|
25
25
|
VeSyncLoginError,
|
|
26
26
|
VeSyncServerError,
|
|
27
27
|
)
|
|
28
|
+
from pyvesync.utils.logs import LibraryLogger
|
|
28
29
|
|
|
29
30
|
if TYPE_CHECKING:
|
|
30
31
|
from pyvesync.vesync import VeSync
|
|
@@ -153,6 +154,10 @@ class VeSyncAuth:
|
|
|
153
154
|
async def reauthenticate(self) -> bool:
|
|
154
155
|
"""Re-authenticate using stored username and password.
|
|
155
156
|
|
|
157
|
+
The current credentials stay in place while the login runs, and also if
|
|
158
|
+
it fails, so requests can still be built and the login tried again. They
|
|
159
|
+
are replaced when the login succeeds.
|
|
160
|
+
|
|
156
161
|
Returns:
|
|
157
162
|
True if re-authentication successful, False otherwise
|
|
158
163
|
|
|
@@ -162,9 +167,11 @@ class VeSyncAuth:
|
|
|
162
167
|
VeSyncServerError: If server returns an error
|
|
163
168
|
"""
|
|
164
169
|
had_saved_credentials = self.credentials_saved
|
|
165
|
-
self.clear_credentials()
|
|
166
170
|
success = await self.login()
|
|
167
|
-
logger.debug(
|
|
171
|
+
logger.debug(
|
|
172
|
+
'Re-authentication successful for user: %s',
|
|
173
|
+
LibraryLogger.redact_value(self._username),
|
|
174
|
+
)
|
|
168
175
|
if had_saved_credentials:
|
|
169
176
|
await self.save_credentials_to_file(self._token_file_path)
|
|
170
177
|
return success
|
|
@@ -314,7 +321,10 @@ class VeSyncAuth:
|
|
|
314
321
|
|
|
315
322
|
# Step 2: Exchange authorization code for token
|
|
316
323
|
await self._exchange_authorization_code(auth_code)
|
|
317
|
-
logger.debug(
|
|
324
|
+
logger.debug(
|
|
325
|
+
'Login successful for user: %s',
|
|
326
|
+
LibraryLogger.redact_value(self._username),
|
|
327
|
+
)
|
|
318
328
|
except (VeSyncLoginError, VeSyncAPIResponseError, VeSyncServerError):
|
|
319
329
|
raise
|
|
320
330
|
except Exception as exc:
|
|
@@ -19,6 +19,7 @@ from pyvesync.const import (
|
|
|
19
19
|
AirFryerFeatures,
|
|
20
20
|
AirFryerModeConfig,
|
|
21
21
|
AirFryerPresetRecipe,
|
|
22
|
+
AirFryerSyncType,
|
|
22
23
|
AirFryerTempLimits,
|
|
23
24
|
TemperatureUnits,
|
|
24
25
|
TimeUnits,
|
|
@@ -84,7 +85,8 @@ class FryerState(DeviceState):
|
|
|
84
85
|
the next update.
|
|
85
86
|
recipe (str | None): The recipe name the device reports. A local
|
|
86
87
|
command sets it only on dual-chamber fryers.
|
|
87
|
-
ready_start (bool): Not used by the library; always False.
|
|
88
|
+
ready_start (bool): Not used by the library; always False. It does
|
|
89
|
+
not reflect the ``ready_start`` argument of the start methods.
|
|
88
90
|
sync_chambers (bool): True only when the device reports the app's Sync
|
|
89
91
|
mode (``syncType`` 2). Dual-chamber fryers only, always False
|
|
90
92
|
otherwise: set by ``update()``, by a successful ``set_mode()`` /
|
|
@@ -196,7 +198,8 @@ class FryerState(DeviceState):
|
|
|
196
198
|
def can_resume(self) -> bool:
|
|
197
199
|
"""Return True if the status is paused (cook or preheat stop).
|
|
198
200
|
|
|
199
|
-
|
|
201
|
+
The CS137/CS158 also reports these statuses while a ``ready_start``
|
|
202
|
+
program waits for its start button. ``READY`` is not paused.
|
|
200
203
|
"""
|
|
201
204
|
return self.cook_status in RESUMABLE_STATUSES
|
|
202
205
|
|
|
@@ -285,6 +288,10 @@ class FryerState(DeviceState):
|
|
|
285
288
|
preheat = self.preheat_time_remaining
|
|
286
289
|
cook = self.cook_last_time
|
|
287
290
|
return None if preheat is None or cook is None else preheat + cook
|
|
291
|
+
if self.cook_status == AirFryerCookStatus.READY and self.preheat_last_time:
|
|
292
|
+
# A waiting program with preheat runs the preheat first.
|
|
293
|
+
cook = self.cook_last_time
|
|
294
|
+
return None if cook is None else self.preheat_last_time + cook
|
|
288
295
|
return self.cook_time_remaining if self.is_in_cook_mode else None
|
|
289
296
|
|
|
290
297
|
def _clear_preheat(self) -> None:
|
|
@@ -1062,7 +1069,8 @@ class VeSyncFryer(VeSyncBaseDevice[FryerState]):
|
|
|
1062
1069
|
"""Return a recipe's cook and preheat times as whole seconds.
|
|
1063
1070
|
|
|
1064
1071
|
The cook time must be at least one API time unit (1 second, or
|
|
1065
|
-
60 seconds on minute-based fryers).
|
|
1072
|
+
60 seconds on minute-based fryers). A mode that declares ``time_limits``
|
|
1073
|
+
also requires its range and step. On fryers with the ``PREHEAT``
|
|
1066
1074
|
feature the preheat time, if given, must be 0 or at least one unit.
|
|
1067
1075
|
Other fryers drop it with a debug log.
|
|
1068
1076
|
|
|
@@ -1074,6 +1082,19 @@ class VeSyncFryer(VeSyncBaseDevice[FryerState]):
|
|
|
1074
1082
|
None when not given or not supported), or None (after a warning)
|
|
1075
1083
|
if either is not valid.
|
|
1076
1084
|
"""
|
|
1085
|
+
mode = self.get_cook_mode(recipe.cook_mode)
|
|
1086
|
+
if (
|
|
1087
|
+
mode is not None
|
|
1088
|
+
and mode.time_limits is not None
|
|
1089
|
+
and not mode.time_limits.accepts(recipe.cook_time)
|
|
1090
|
+
):
|
|
1091
|
+
logger.warning(
|
|
1092
|
+
'Cook time %s is outside the limits or steps of %s for %s',
|
|
1093
|
+
recipe.cook_time,
|
|
1094
|
+
mode.api_mode,
|
|
1095
|
+
self.device_name,
|
|
1096
|
+
)
|
|
1097
|
+
return None
|
|
1077
1098
|
minimum = self.convert_time_for_state(1)
|
|
1078
1099
|
try:
|
|
1079
1100
|
cook_time = int(recipe.cook_time)
|
|
@@ -1185,8 +1206,9 @@ class VeSyncFryer(VeSyncBaseDevice[FryerState]):
|
|
|
1185
1206
|
) -> bool:
|
|
1186
1207
|
"""Stop (Pause) the current cooking or preheating session.
|
|
1187
1208
|
|
|
1188
|
-
|
|
1189
|
-
|
|
1209
|
+
Supported by the CS137/CS158 (``VeSyncAirFryer158``) and dual fryers
|
|
1210
|
+
with the ``RESUMABLE`` feature (CAF-DC111S-AEU); other fryers return
|
|
1211
|
+
False without a request. The command is always sent:
|
|
1190
1212
|
the preheat stop when the last known state is a preheat phase,
|
|
1191
1213
|
otherwise the cook stop. Every successful command sets the state to
|
|
1192
1214
|
the phase it sent, so the next command picks the matching one.
|
|
@@ -1207,12 +1229,18 @@ class VeSyncFryer(VeSyncBaseDevice[FryerState]):
|
|
|
1207
1229
|
) -> bool:
|
|
1208
1230
|
"""Resume a paused cooking or preheating session.
|
|
1209
1231
|
|
|
1210
|
-
|
|
1211
|
-
|
|
1232
|
+
Supported by the CS137/CS158 (``VeSyncAirFryer158``) and dual fryers
|
|
1233
|
+
with the ``RESUMABLE`` feature (CAF-DC111S-AEU); other fryers return
|
|
1234
|
+
False without a request. The command is always sent:
|
|
1212
1235
|
the preheat resume when the last known state is a preheat phase,
|
|
1213
1236
|
otherwise the cook resume. The remaining time carries over, so a
|
|
1214
1237
|
resume while running does not restart the countdown.
|
|
1215
1238
|
|
|
1239
|
+
While a ``ready_start`` program waits for the start button, the
|
|
1240
|
+
CS137/CS158 sends the same command and the CAF-DC111S-AEU sends
|
|
1241
|
+
``resumeWork`` and leaves the ``READY`` chamber unchanged. No capture
|
|
1242
|
+
shows whether either starts the waiting cook.
|
|
1243
|
+
|
|
1216
1244
|
Arguments:
|
|
1217
1245
|
chamber (AirFryerChamber | int): The chamber to resume for. Default
|
|
1218
1246
|
is ``CHAMBER_1``.
|
|
@@ -1224,7 +1252,7 @@ class VeSyncFryer(VeSyncBaseDevice[FryerState]):
|
|
|
1224
1252
|
logger.info('resume not supported by this fryer.')
|
|
1225
1253
|
return False
|
|
1226
1254
|
|
|
1227
|
-
async def set_mode(
|
|
1255
|
+
async def set_mode( # noqa: PLR0913
|
|
1228
1256
|
self,
|
|
1229
1257
|
cook_time: int,
|
|
1230
1258
|
cook_temp: int,
|
|
@@ -1233,6 +1261,7 @@ class VeSyncFryer(VeSyncBaseDevice[FryerState]):
|
|
|
1233
1261
|
preheat_time: int | None = None,
|
|
1234
1262
|
cook_mode: str | None = None,
|
|
1235
1263
|
chamber: AirFryerChamber | int = AirFryerChamber.CHAMBER_1,
|
|
1264
|
+
ready_start: bool = True,
|
|
1236
1265
|
) -> bool:
|
|
1237
1266
|
"""Start a cook with the given time and temperature.
|
|
1238
1267
|
|
|
@@ -1247,8 +1276,9 @@ class VeSyncFryer(VeSyncBaseDevice[FryerState]):
|
|
|
1247
1276
|
cook_time (int): The cooking time in seconds, at least 1 (60 on
|
|
1248
1277
|
the CS137/CS158, whose API uses minutes and truncates to whole
|
|
1249
1278
|
minutes). A shorter time returns False without a request.
|
|
1250
|
-
|
|
1251
|
-
|
|
1279
|
+
A mode's ``time_limits``, where declared, also apply; a time
|
|
1280
|
+
outside them returns False without a request. Other modes have
|
|
1281
|
+
no upper limit.
|
|
1252
1282
|
cook_temp (int): The cooking temperature, in ``temp_unit``.
|
|
1253
1283
|
temp_unit (TemperatureUnits | str | None): The unit of
|
|
1254
1284
|
``cook_temp``; defaults to the device's current ``temp_unit``.
|
|
@@ -1267,19 +1297,63 @@ class VeSyncFryer(VeSyncBaseDevice[FryerState]):
|
|
|
1267
1297
|
chamber (AirFryerChamber | int): The chamber to cook in. Default is
|
|
1268
1298
|
``CHAMBER_1``. A chamber not in ``supported_chambers`` returns
|
|
1269
1299
|
False without a request.
|
|
1300
|
+
ready_start (bool): True (the default) sends the cook without
|
|
1301
|
+
starting it: the fryer shows it and waits for its start
|
|
1302
|
+
button (status ``READY``; the CS137/CS158 reports
|
|
1303
|
+
``COOK_STOP``, or ``PREHEAT_STOP`` with a preheat). False
|
|
1304
|
+
starts the cook at once.
|
|
1270
1305
|
|
|
1271
1306
|
Returns:
|
|
1272
1307
|
bool: True if the command was successful, False otherwise.
|
|
1273
1308
|
"""
|
|
1274
1309
|
del cook_time, cook_temp, chamber, preheat_time, cook_mode, temp_unit
|
|
1310
|
+
del ready_start
|
|
1275
1311
|
logger.warning('set_mode method not implemented for base fryer class.')
|
|
1276
1312
|
return False
|
|
1277
1313
|
|
|
1314
|
+
async def set_chamber_modes(
|
|
1315
|
+
self,
|
|
1316
|
+
chamber_1: AirFryerPresetRecipe,
|
|
1317
|
+
chamber_2: AirFryerPresetRecipe | None = None,
|
|
1318
|
+
*,
|
|
1319
|
+
sync_type: AirFryerSyncType = AirFryerSyncType.SYNC,
|
|
1320
|
+
ready_start: bool = True,
|
|
1321
|
+
) -> bool:
|
|
1322
|
+
"""Start a recipe in each chamber, or one recipe in both.
|
|
1323
|
+
|
|
1324
|
+
Only fryers with the ``CHAMBER_MODES`` feature implement this. Both
|
|
1325
|
+
recipes are checked before any request, as in
|
|
1326
|
+
``set_mode_from_recipe()``, so an invalid second recipe does not start
|
|
1327
|
+
the first. On success both chamber states are set locally from the
|
|
1328
|
+
request; call ``update()`` for the device's reported state.
|
|
1329
|
+
|
|
1330
|
+
Args:
|
|
1331
|
+
chamber_1 (AirFryerPresetRecipe): Recipe for chamber 1 with
|
|
1332
|
+
``SYNC`` or ``OFF``, or the recipe for both chambers with
|
|
1333
|
+
``MATCH``.
|
|
1334
|
+
chamber_2 (AirFryerPresetRecipe | None): Recipe for chamber 2.
|
|
1335
|
+
Required with ``SYNC`` and ``OFF``; must be None with ``MATCH``.
|
|
1336
|
+
sync_type (AirFryerSyncType): ``SYNC`` for separate recipes that
|
|
1337
|
+
finish together, ``OFF`` for separate recipes that each run on
|
|
1338
|
+
their own time, or ``MATCH`` for identical settings.
|
|
1339
|
+
ready_start (bool): True (the default) sends the cook without
|
|
1340
|
+
starting it: the fryer shows it and waits for its start
|
|
1341
|
+
button (status ``READY``). False starts the cook at once.
|
|
1342
|
+
|
|
1343
|
+
Returns:
|
|
1344
|
+
bool: True if the command was successful. An unsupported fryer or
|
|
1345
|
+
an invalid combination returns False without a request.
|
|
1346
|
+
"""
|
|
1347
|
+
del chamber_1, chamber_2, sync_type, ready_start
|
|
1348
|
+
logger.debug('Separate chamber modes are not configured for %s', self.device_name)
|
|
1349
|
+
return False
|
|
1350
|
+
|
|
1278
1351
|
async def set_mode_from_recipe(
|
|
1279
1352
|
self,
|
|
1280
1353
|
recipe: AirFryerPresetRecipe,
|
|
1281
1354
|
*,
|
|
1282
1355
|
chamber: AirFryerChamber | int = AirFryerChamber.CHAMBER_1,
|
|
1356
|
+
ready_start: bool = True,
|
|
1283
1357
|
) -> bool:
|
|
1284
1358
|
"""Start a cook from a recipe.
|
|
1285
1359
|
|
|
@@ -1297,6 +1371,11 @@ class VeSyncFryer(VeSyncBaseDevice[FryerState]):
|
|
|
1297
1371
|
chamber (AirFryerChamber | int): The chamber to cook in. Default is
|
|
1298
1372
|
``CHAMBER_1``. A chamber not in ``supported_chambers`` returns
|
|
1299
1373
|
False without a request.
|
|
1374
|
+
ready_start (bool): True (the default) sends the cook without
|
|
1375
|
+
starting it: the fryer shows it and waits for its start
|
|
1376
|
+
button (status ``READY``; the CS137/CS158 reports
|
|
1377
|
+
``COOK_STOP``, or ``PREHEAT_STOP`` with a preheat). False
|
|
1378
|
+
starts the cook at once.
|
|
1300
1379
|
|
|
1301
1380
|
Returns:
|
|
1302
1381
|
bool: True if the command was successful, False otherwise.
|
|
@@ -1306,7 +1385,7 @@ class VeSyncFryer(VeSyncBaseDevice[FryerState]):
|
|
|
1306
1385
|
``dataclasses.replace``. See
|
|
1307
1386
|
[AirFryerPresetRecipe][pyvesync.const.AirFryerPresetRecipe].
|
|
1308
1387
|
"""
|
|
1309
|
-
del recipe, chamber
|
|
1388
|
+
del recipe, chamber, ready_start
|
|
1310
1389
|
logger.warning(
|
|
1311
1390
|
'set_mode_from_recipe method not implemented for base fryer class.'
|
|
1312
1391
|
)
|
|
@@ -1317,9 +1396,10 @@ class VeSyncFryer(VeSyncBaseDevice[FryerState]):
|
|
|
1317
1396
|
) -> bool:
|
|
1318
1397
|
"""Start cooking after the preheat has finished.
|
|
1319
1398
|
|
|
1320
|
-
|
|
1321
|
-
|
|
1322
|
-
|
|
1399
|
+
The CS137/CS158 (``VeSyncAirFryer158``) and the CS358
|
|
1400
|
+
(``VeSyncAirFryer358``) support this; other fryers return False
|
|
1401
|
+
without a request. The last known ``cook_status`` must be
|
|
1402
|
+
``PREHEAT_END``, so call ``update()`` after
|
|
1323
1403
|
the preheat finishes; otherwise it returns False without a request.
|
|
1324
1404
|
|
|
1325
1405
|
Args:
|