VeSync Air Fryers↲
pyvesync supports these Cosori smart air fryers. All of them are in
manager.devices.air_fryers after get_devices().
| Model | Class | Chambers | Preheat | Pause / resume | Unit before first update() |
|---|---|---|---|---|---|
| CS137-AF, CS158-AF (3.7 and 5.8 Qt.) | VeSyncAirFryer158 |
1 | ✔ | ✔ | °F |
| CAF-DC601S TurboBlaze 6 Qt. | VeSyncTurboBlazeFryer |
1 | ✔ | °F | |
| CAF-P583S Dual Blaze 6.8 Qt. (KUS, KEU) | VeSyncDualBlazeFryer |
1 | °F (KUS), °C (KEU) | ||
| CAF-TF101S Dual Air Fryer | VeSyncDualAirFryer |
1, 2, whole, both | °C | ||
| CAF-DC111S-AEU Turbo Tower Pro | VeSyncDualAirFryer |
1 (upper), 2 (lower), both | °C |
The CAF-TF102S uses VeSyncDualAirFryer and the same chambers, without the
Dry mode. Its mapping comes from the VeSync app and is pending hardware
verification. The CAF-P583S KEU has no packet capture; it is assumed to match
the KUS apart from its Celsius unit. The CAF-DC111S-AEU mapping comes from
the VeSync app and the status captures supplied with PR #536; its cook and
end requests are pending hardware verification.
Every fryer has set_mode(), set_mode_from_recipe(), end() and
update(). stop() and resume() are implemented for the CS137/CS158 and
the CAF-DC111S-AEU, cook_from_preheat() only for the CS137/CS158; on the
other fryers they log a message and return False without sending a request. Air fryers have no on/off command
and no turn_on() / turn_off(); the CS137/CS158 toggle_switch() is
deprecated and sends no request.
Quick start↲
import asyncio
from pyvesync import VeSync
async def main():
async with VeSync(username="EMAIL", password="PASSWORD") as manager:
await manager.login()
await manager.get_devices()
fryer = manager.devices.air_fryers[0]
await fryer.update()
print(fryer.state.cook_status, fryer.temp_unit)
# Cook for 15 minutes at 400 °F (converted on Celsius fryers)
if await fryer.set_mode(15 * 60, 400, temp_unit='f'):
print(fryer.state.cook_time_remaining)
await fryer.end()
asyncio.run(main())
Every control method returns True when the device accepted the command and
False otherwise. A rejected argument (unsupported chamber, cook mode,
temperature, time or unit) returns False before any request is sent, with a
log message saying why. The control methods and update() log problems
rather than raising them.
A failed or unreadable update() (no response, an error code, an unknown
cook status, an out-of-range step) logs a message and leaves the chamber
state as it was, so a command afterwards still sees the last known phase.
On the dual-chamber fryers (CAF-TF101S/TF102S, CAF-DC111S-AEU) both
chambers take the connection status and update time from the response, and
a chamber with an unknown status keeps its state.
A reported temperature unit pyvesync does not recognise is logged and the
current unit kept.
A command the fryer refuses returns False and leaves the state as it was;
fryer.last_response names the reason. For example, the CAF-DC111S-AEU can
refuse a Sync cook (chamber=BOTH) with BYPASS_SYNC_FINISH_FAIL_1 (open
the other basket), BYPASS_SYNC_FINISH_FAIL_2 (reduce the cooking time of
the current basket) or BYPASS_AVATAR_SYNC_FAIL (Sync cannot start while
cooking).
Cooking↲
await fryer.set_mode(cook_time, cook_temp, *, temp_unit=None,
preheat_time=None, cook_mode=None, chamber=CHAMBER_1)
cook_timeandpreheat_timeare in seconds, as whole numbers (a fraction is dropped, except on the fryers with per-mode time limits, which reject it).cook_timemust be at least 1 second. The CS137/CS158 API counts in whole minutes, so pyvesync rounds the time down to the minute (90 s is sent as 1 minute) and rejects acook_timeunder 60 s. The CAF-TF101S/TF102S and CAF-DC111S-AEU also check each mode's range and step (see Cook time limits). Other fryers have no upper limit: a longer time is sent as given and the fryer may refuse it.cook_tempis in the fryer'stemp_unit, or intemp_unitif you pass one (see Temperature units).- With no
cook_mode, the fryer's default preset is used: Manual Cooking on the CS137/CS158 and Air Fry on the others. Only the preset's mode, recipe ID, name and type are sent; the time and temperature are yours. See Cook modes for the other modes. - The temperature is rounded to the nearest step of the mode, never rejected for being off-step, and then checked against the mode's range (see Temperature limits).
preheat_timestarts a preheat phase on fryers with preheat. There it must be 0 (no preheat) or at least one API time unit: 1 second, or 60 seconds on the CS137/CS158, which also rounds it down to whole minutes. A negative or shorter time returnsFalsewithout a request. The CAF-P583S and the dual-chamber fryers (CAF-TF101S/TF102S, CAF-DC111S-AEU) have no preheat and drop it (with a debug log).- pyvesync sends
readyStartfalse. The CS137/CS158 capture shows the cook then starts at once, without the start button; the other models are assumed to behave the same.
After a successful command the chamber's state is set from the request
(status, set time, remaining time, temperature and mode), and the remaining
times count down locally. The next update() replaces them with what the
device reports.
Recipes↲
get_mode_recipe(cook_mode) returns a cook mode's preset at the VeSync app's
default time and temperature, as an AirFryerPresetRecipe, or None if the
fryer has no such mode. Pass it to set_mode_from_recipe(), changing the
time, temperature or preheat first if needed:
from dataclasses import replace
from pyvesync.const import AirFryerCookModes
recipe = fryer.get_mode_recipe(AirFryerCookModes.ROAST)
if recipe is not None:
recipe = replace(recipe, cook_time=25 * 60, preheat_time=3 * 60)
await fryer.set_mode_from_recipe(recipe)
AirFryerPresetRecipe holds recipe_name, cook_mode, recipe_id,
recipe_type, target_temp, temp_unit ('f' or 'c'), cook_time and
preheat_time (both in seconds; preheat_time is optional). The recipe's
temperature is converted to the fryer's unit if needed, rounded and checked
against the limits of the recipe's cook_mode. The times are checked as for
set_mode(). The recipe's cook_mode must be one of the fryer's modes (see
Cook modes); otherwise the method returns False without a
request. Its mode, ID, name and type are sent as given, so start from
get_mode_recipe() rather than inventing them. cook_mode is the API mode
string ('AirFry', 'poultry') or an AirFryerCookModes key; the API mode
string is what is sent. A recipe temp_unit that does not start with c or
f returns False without a request.
fryer.default_preset is the recipe set_mode() copies when no cook_mode
is given. Each fryer has its own copy, so changing it affects only that
fryer. Its own time and temperature are pyvesync defaults and can differ
from get_mode_recipe() for the same mode; use get_mode_recipe() for the
app's defaults.
Controlling a cook↲
| Method | What it does | Fryers |
|---|---|---|
end(chamber) |
Ends the cook or preheat and returns the chamber to standby. | All |
stop(chamber) |
Pauses the cook or preheat. | CS137/CS158, CAF-DC111S-AEU |
resume(chamber) |
Resumes a paused cook or preheat. | CS137/CS158, CAF-DC111S-AEU |
cook_from_preheat(chamber) |
Starts the cook once preheat has finished (PREHEAT_END). |
CS137/CS158 |
On the CS137/CS158, end(), stop() and resume() use the last known
status (from update() or the last successful command) to choose between the
cook and preheat commands. Paused, basket-out and preheat-finished count as in
a phase.
stop()andresume()are always sent: the preheat command during a preheat phase, otherwise the cook command (also in standby). They don't check whether the fryer is already paused or running.end()returnsFalsewithout a request when the fryer is in neither a cook nor a preheat phase (standby, orAPPOINTING, so a scheduled cook cannot be cancelled).- Every successful command sets the state to the phase it sent (
stop()givesCOOK_STOPorPREHEAT_STOP,resume()givesCOOKINGorHEATING), so the next command picks the matching one without anupdate(). The remaining time carries over, soresume()while running does not restart the countdown.
Call update() first if the fryer may have changed state on its own.
The CAF-DC111S-AEU pauses and resumes with pauseWork / resumeWork and a
chamber (the app has no pause button, the fryer's panel does). stop(1) or
stop(2) pauses one chamber while the other keeps cooking; BOTH pauses
both in one request. A paused chamber reports cookStop with its remaining
time held, and during a Sync cook the other chamber's HOLD wait stops too.
resume() continues from the held time. Verified on firmware 2.0.02 (MCU
1.0.10). The TF101S/TF102S have no RESUMABLE feature, so stop() and
resume() return False without a request there.
On the dual-chamber fryers, pulling a basket out pauses that chamber
(pullOut) and pushing it back in resumes it; no TF101S capture of this
exists yet.
Reading status↲
update() polls the device. Single-chamber fryers keep their status in
fryer.state; dual-chamber fryers have state_chamber_1 and
state_chamber_2 (state is state_chamber_1), and get_chamber_state()
returns the state for one chamber. All times are in seconds and all
temperatures in the fryer's temp_unit.
| Attribute | Meaning |
|---|---|
cook_status |
An AirFryerCookStatus member (see below). |
cook_mode, recipe |
The API mode string and recipe name of the current or last cook (cook_mode is kept in standby). After a local command, recipe is set only on the dual-chamber fryers; the other fryers fill it on update(). |
cook_set_temp, current_temp |
The set and measured temperatures. The dual-chamber fryers' status has no measured-temperature field, so current_temp stays None. |
cook_set_time, preheat_set_time |
The set cook and preheat times. |
cook_time_remaining, preheat_time_remaining |
Remaining cook and preheat time, counting down from the last update while running (and during HOLD while the other chamber cooks, where cook_time_remaining is the wait before the chamber starts). None outside that phase. |
total_time_remaining |
Time until the cook finishes, preheat included. None in standby, and on the CS137/CS158 during preheat once an update() has run (that fryer reports no cook time then). |
is_cooking, is_preheating, is_running |
is_cooking is True in COOKING, is_preheating in HEATING, is_running in either. |
is_in_cook_mode, is_in_preheat_mode |
True in any cook or preheat status, running or not (for example COOK_STOP, COOK_END, PREHEAT_END), and with the basket out during that phase. |
can_resume |
True when paused (COOK_STOP or PREHEAT_STOP). |
AirFryerCookStatus values (from pyvesync.const). Not every fryer reports
every status:
| Member | Meaning |
|---|---|
STANDBY |
Idle. |
HEATING |
Preheating. |
PREHEAT_STOP |
Preheat paused. |
PREHEAT_END |
Preheat finished, waiting for cook_from_preheat() (CS137/CS158). |
COOKING |
Cooking. |
COOK_STOP |
Cook paused. |
PULL_OUT |
Basket pulled out. |
COOK_END |
Cook finished. |
READY |
Set up and waiting to start on the fryer. |
APPOINTING |
Waiting for a delayed start set in the app (CS137/CS158). pyvesync cannot set one. |
HOLD |
Sync cook with different times: this chamber waits so both finish together (CAF-DC111S-AEU). cook_time_remaining is the wait and total_time_remaining includes the cook; both count down only while the other chamber is cooking, and stop while it is paused. Counts as cook mode; is_running is False. Start one with set_chamber_modes(), the app or the fryer; pyvesync's BOTH sends the same settings to both chambers, so it does not report this status. |
The CAF-P583S status map maps keeping (keep-warm) to COOKING; no capture
of it exists yet. COMPLETED and UNKNOWN are in the enum but no supported
fryer reports them.
The CAF-TF101S and CAF-TF102S also map HOLD and COOK_END. That follows the
VeSync app; no capture or report shows either status on these models.
Each state's to_dict() / to_json() gives all of these values at once.
Chambers↲
Every fryer method that targets a basket takes a chamber argument, an
AirFryerChamber member (from pyvesync.const) or its integer value. The
values match the API's workChamber / chamber fields.
| Member | Value | Meaning |
|---|---|---|
CHAMBER_1 |
1 | Chamber 1 (left; upper on the CAF-DC111S-AEU). The default, and the only chamber on single-basket fryers. |
CHAMBER_2 |
2 | Chamber 2 (right; lower on the CAF-DC111S-AEU). Dual-chamber fryers only. |
WHOLE |
3 | The merged basket with the divider removed. CAF-TF101S/TF102S only (WHOLE_CHAMBER feature). |
BOTH |
4 | Both chambers with the same settings, sent as the app's Sync mode (both chambers finish together). Dual-chamber fryers only. |
supported_chambers lists the chambers a fryer accepts, and is_dual_chamber
is True for dual-basket models.
On a dual-chamber fryer:
from pyvesync.const import AirFryerChamber
await fryer.set_mode(600, 200, chamber=AirFryerChamber.CHAMBER_2)
await fryer.set_mode_from_recipe(recipe, chamber=AirFryerChamber.BOTH)
await fryer.end(AirFryerChamber.BOTH)
await fryer.update()
chamber_state = fryer.get_chamber_state(AirFryerChamber.CHAMBER_2)
if chamber_state is not None:
remaining = chamber_state.cook_time_remaining
A chamber the fryer does not support makes the method return False without
sending a request. get_chamber_state() returns None (with a debug log)
for BOTH, which names two states (read state_chamber_1 and
state_chamber_2 instead), and for a chamber the fryer does not support.
sync_chambers and work_chamber are read-only. update() sets both from
the device; sync_chambers is also set by a successful start or end(BOTH).
They are the same on the fryer and on both chamber states, and on
single-chamber fryers they are always False and None.
sync_chambersis True only when the device reports the app's Sync mode (both chambers finish together). The app's Match mode reports False. A successfulset_mode()orset_mode_from_recipe()also sets it (True forBOTH, False otherwise), as doesset_chamber_modes()(True forSYNC, False forMATCH), andend(BOTH)clears it.work_chamberis the chamber the device reports as active. It isNonewhen the fryer is idle, and alwaysNoneon single-chamber fryers. Besidesupdate(), a successfulWHOLEstart sets it toWHOLE, any other start clears aWHOLEvalue, and a successfulend(WHOLE)orend(BOTH)clears it.
To cook both chambers, pass chamber=AirFryerChamber.BOTH. During a Sync
cook, end() with one chamber sends an end for that chamber only; use
end(AirFryerChamber.BOTH) to end both. During a whole-basket cook
(work_chamber is WHOLE), end() with the default CHAMBER_1 ends the
whole basket.
Different recipes per chamber (CAF-DC111S-AEU)↲
set_chamber_modes() starts cooking in both chambers from recipes. It needs
the AirFryerFeatures.CHAMBER_MODES feature, which only the CAF-DC111S-AEU has;
other fryers return False without a request.
AirFryerSyncType.SYNC(the default) takes one recipe per chamber: the first for the upper basket, the second for the lower. They can differ in mode, temperature and time. The shorter recipe waits inHOLDso both finish together.AirFryerSyncType.OFFtakes one recipe per chamber, and each starts at once and runs on its own time.AirFryerSyncType.MATCHtakes one recipe and uses it for both chambers.
from dataclasses import replace
from pyvesync.const import AirFryerSyncType
first = fryer.get_mode_recipe('AirFry')
second = fryer.get_mode_recipe('Bake')
if first is not None and second is not None:
first = replace(first, target_temp=180, temp_unit='c', cook_time=180)
second = replace(second, target_temp=160, temp_unit='c', cook_time=300)
await fryer.set_chamber_modes(first, second, sync_type=AirFryerSyncType.SYNC)
# Or start one recipe in both chambers instead
await fryer.set_chamber_modes(second, sync_type=AirFryerSyncType.MATCH)
Both recipes are checked before any request, so an invalid second recipe does
not start the first. A refused command leaves both chamber states unchanged.
set_mode(..., chamber=BOTH) is unchanged and sends the same settings to both
chambers.
Cook modes↲
cook_modes lists each fryer's presets from the VeSync app, keyed by
AirFryerCookModes (from pyvesync.const). Each entry holds the mode string
the API uses, the preset's recipe ID and name, its default time and
temperatures, and its temperature limits. get_cook_mode() looks one up by
key or by API mode string.
| Fryer | Modes |
|---|---|
| CS137/CS158 | CUSTOM (Manual Cooking, the default), STEAK, CHICKEN, SEAFOOD, BACON, VEGETABLES, ROOT_VEGETABLES, FROZEN, DESSERTS, SHRIMP, BREAD, FRENCH_FRIES |
| CAF-DC601S | AIRFRY (default), ROAST, BROIL, FROZEN, REHEAT, BAKE, DRY, PROOF, WARM |
| CAF-P583S | AIRFRY (default), BROIL, ROAST, BAKE, CHICKEN, STEAK, SEAFOOD, VEGETABLES, FRENCH_FRIES, FROZEN, REHEAT |
| CAF-TF101S | AIRFRY (default), ROAST, BAKE, GRILL, REHEAT, DRY |
| CAF-TF102S | AIRFRY (default), ROAST, BAKE, GRILL, REHEAT |
| CAF-DC111S-AEU | AIRFRY (default), BAKE, ROAST, GRILL, REHEAT, DRY, PROOF |
set_mode(..., cook_mode=...) accepts an AirFryerCookModes key or the API
mode string, and sends that preset's recipe ID, name and type. With no cook_mode
it sends the fryer's default preset. set_mode(cook_mode=...) with a mode the
fryer does not have returns False without sending a request.
set_mode_from_recipe() sends the recipe's own cook_mode and checks its
temperature against that mode's limits, or the default mode's limits if the
fryer has no such mode.
from pyvesync.const import AirFryerCookModes
# Bake exists on the CAF-DC601S, CAF-P583S, CAF-TF101S/TF102S and CAF-DC111S-AEU
await fryer.set_mode(1200, 330, temp_unit='f', cook_mode=AirFryerCookModes.BAKE)
# The preset at its app defaults, for set_mode_from_recipe()
recipe = fryer.get_mode_recipe(AirFryerCookModes.BAKE)
if recipe is not None:
await fryer.set_mode_from_recipe(recipe)
Temperature limits↲
Each cook mode has its own temperature range and step in both Celsius and
Fahrenheit, taken from the VeSync app. temp_limits(cook_mode) returns them
in the fryer's current temp_unit; with no mode, or a mode the fryer does
not have, it returns the default mode's limits.
limits = fryer.temp_limits('Grill') # CAF-TF101S/TF102S Grill
print(limits.min_temp, limits.max_temp, limits.step)
A requested temperature is rounded to the nearest multiple of its mode's
step, then checked against its mode's range. Off-step temperatures are
always rounded, never rejected. Rounding uses Python's round(), so a value exactly halfway
between two steps goes to the even multiple: with a 10° step, 395 becomes 400
but 385 becomes 380. A temperature outside the range makes the method return
False without sending a request.
min_temp and max_temp are the widest span across all of the fryer's
modes, for display. A temperature inside that span can still be outside the
range of the mode you cook with; check temp_limits(cook_mode) before
calling set_mode(). temperature_step is the default mode's step.
Cook time limits↲
The CAF-DC111S-AEU limits each mode's cook time to the range and step in the VeSync app:
| Mode | Range | Step |
|---|---|---|
| AirFry, Bake, Roast, Grill, Reheat | 1-60 minutes | 1 minute |
| Dry | 30 minutes-24 hours | 30 minutes |
| Proof | 15 minutes-12 hours | 15 minutes |
The CAF-TF101S and CAF-TF102S have their own limits, also from the app. The CAF-TF102S has no Dry mode.
| Mode | Range | Step |
|---|---|---|
| AirFry, Reheat | 1-60 minutes | 1 minute |
| Roast, Bake | 1 minute-4 hours | 1 minute |
| Grill | 1-30 minutes | 1 minute |
| Dry | 30 minutes-48 hours | 30 minutes |
Times are still given in seconds. A time outside the range or off the step
makes the method return False without sending a request. Unlike a
temperature, a time is never rounded, because that would silently change how
long the food cooks. A whole number given as a float or string (600.0,
'600') is accepted; a fraction or a boolean is not.
Other fryers have no per-mode time limits and check only the minimum described under Cooking.
Temperature units↲
The fryer's temp_unit comes from each update(). Before the first update it
is the device map's default for that model or region. Temperatures in the
state, and cook_temp passed to set_mode(), are in this unit.
Pass temp_unit to give cook_temp in another unit; pyvesync converts it to
the device unit before sending:
temp_unit accepts a TemperatureUnits member or a string starting with
c or f ('c', 'celsius', 'F', ...). Any other string makes the method
return False without sending a request.
A unit changed on the device between update() and a command is not
detected; call update() first if the unit may have changed.
pyvesync converts with the formula (TemperatureUnits.to_celsius /
to_fahrenheit) and then rounds to the cook mode's step. The VeSync app
instead pairs each mode's Celsius and Fahrenheit lists by position, so a
converted temperature can be one step away from what the app shows for the
same input. Pass cook_temp in the device's own unit to avoid conversion.
API reference↲
pyvesync.devices.vesynckitchen ↲
VeSync Cosori air fryers.
VeSyncAirFryer158: CS137/CS158 (Bypass V1 API, times in minutes).VeSyncTurboBlazeFryer: CAF-DC601S (bypassV2startCook).VeSyncDualBlazeFryer: CAF-P583S (bypassV2startCook).VeSyncDualAirFryer: CAF-TF101S / CAF-TF102S / CAF-DC111S (bypassV2startMultiCook, two chambers).
A successful command sets the chamber state locally from the request; it does
not call update(). Call update() to read what the device reports. A
failed or unreadable poll logs and leaves the state unchanged. The CS137/CS158
end(), stop(), resume() and cook_from_preheat() choose the cook
or preheat command from the last known state, which every successful command
keeps in the phase it sent.
pyvesync.devices.vesynckitchen.VeSyncAirFryer158 ↲
Bases: VeSyncFryer
Cosori CS137/CS158 air fryer (Bypass V1 API).
The API counts time in whole minutes, so times are truncated to the minute
when sent, and a cook time under 60 seconds is rejected. This is the only
fryer class that implements stop(), resume() and
cook_from_preheat(). They and end() choose the cook or preheat
command from the last known state. stop() and resume() are sent in
any state (the cook command when not preheating), and every successful
command sets the state to the phase it sent, so the next command matches.
A device whose config module is not in AIRFRYER_PID_MAP raises
VeSyncError, and the device container skips it with a warning.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
details
|
ResponseDeviceDetailsModel
|
Device details. |
required |
manager
|
VeSync
|
Manager class. |
required |
feature_map
|
AirFryerMap
|
Device feature map. |
required |
Attributes:
| Name | Type | Description |
|---|---|---|
pid |
str
|
Product ID from |
request_keys |
tuple[str, ...]
|
Keys copied into every request body. |
last_response |
ResponseInfo
|
Last response from API call. |
manager |
VeSync
|
Manager object for API calls. |
device_name |
str
|
Name of device. |
device_image |
str
|
URL for device image. |
cid |
str
|
Device ID. |
connection_type |
str
|
Connection type of device. |
device_type |
str
|
Type of device. |
type |
str
|
Type of device. |
uuid |
str
|
UUID of device, not always present. |
config_module |
str
|
Configuration module of device. |
mac_id |
str
|
MAC ID of device. |
current_firm_version |
str
|
Current firmware version of device. |
device_region |
str
|
Region of device. (US, EU, etc.) |
sub_device_no |
int
|
Sub-device number of device. |
product_type |
str
|
Product type of device. |
Source code in src/pyvesync/devices/vesynckitchen.py
59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 | |
features
instance-attribute
↲
Inherited From VeSyncBaseDevice
toggle_switch
async
deprecated
↲
Deprecated
There is no on/off function for Air Fryers.
Do nothing; air fryers have no on/off command.
No request is sent.
Returns:
| Name | Type | Description |
|---|---|---|
bool |
bool
|
|
Source code in src/pyvesync/devices/vesynckitchen.py
call_158_api
async
↲
call_158_api(
request_model: type[Fryer158RequestModel],
update_dict: dict | None = None,
method: str = 'bypass',
endpoint: str = 'bypass',
) -> dict | None
Send a Cosori 158 API request.
This uses the _build_158_request method to send API requests
to the Cosori 158 API.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
request_model
|
type[Fryer158RequestModel]
|
The request model to use. |
required |
update_dict
|
dict | None
|
Additional keys to add on. |
None
|
method
|
str
|
The method to use in the outer body. |
'bypass'
|
endpoint
|
str
|
The last part of the url path, defaults to
|
'bypass'
|
Returns:
| Type | Description |
|---|---|
dict | None
|
dict | None: The response JSON, or None if there was no valid |
dict | None
|
response. |
Source code in src/pyvesync/devices/vesynckitchen.py
get_details
async
↲
Inherited From VeSyncBaseDevice
Get device details.
This method is defined in each device class to contain
the logic to pull the device state from the API and update
the device's state attribute. The update() method should
be called to update the device state.
Source code in src/pyvesync/devices/vesynckitchen.py
end
async
↲
end(chamber: AirFryerChamber | int = CHAMBER_1) -> bool
Inherited From VeSyncFryer
End the current cooking or preheating session.
On success the chamber state is set to standby. On the CS137/CS158
the command depends on the last known state, and it returns False
without a request when that state is neither cooking nor preheating.
On the CAF-TF101S/TF102S, CHAMBER_1 during a whole-basket cook
(work_chamber WHOLE) ends the whole basket.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
chamber
|
AirFryerChamber | int
|
The chamber to end for. Default
is |
CHAMBER_1
|
Returns:
| Name | Type | Description |
|---|---|---|
bool |
bool
|
True if the command was successful, False otherwise. |
Source code in src/pyvesync/devices/vesynckitchen.py
stop
async
↲
stop(chamber: AirFryerChamber | int = CHAMBER_1) -> bool
Inherited From VeSyncFryer
Stop (Pause) the current cooking or preheating session.
Supported by the CS137/CS158 (VeSyncAirFryer158) and dual fryers
with the RESUMABLE feature (CAF-DC111S-AEU); other fryers return
False without a request. The command is always sent:
the preheat stop when the last known state is a preheat phase,
otherwise the cook stop. Every successful command sets the state to
the phase it sent, so the next command picks the matching one.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
chamber
|
AirFryerChamber | int
|
The chamber to stop for. Default
is |
CHAMBER_1
|
Returns:
| Name | Type | Description |
|---|---|---|
bool |
bool
|
True if the command was successful, False otherwise. |
Source code in src/pyvesync/devices/vesynckitchen.py
resume
async
↲
resume(chamber: AirFryerChamber | int = CHAMBER_1) -> bool
Inherited From VeSyncFryer
Resume a paused cooking or preheating session.
Supported by the CS137/CS158 (VeSyncAirFryer158) and dual fryers
with the RESUMABLE feature (CAF-DC111S-AEU); other fryers return
False without a request. The command is always sent:
the preheat resume when the last known state is a preheat phase,
otherwise the cook resume. The remaining time carries over, so a
resume while running does not restart the countdown.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
chamber
|
AirFryerChamber | int
|
The chamber to resume for. Default
is |
CHAMBER_1
|
Returns:
| Name | Type | Description |
|---|---|---|
bool |
bool
|
True if the command was successful, False otherwise. |
Source code in src/pyvesync/devices/vesynckitchen.py
set_mode_from_recipe
async
↲
set_mode_from_recipe(
recipe: AirFryerPresetRecipe,
*,
chamber: AirFryerChamber | int = CHAMBER_1,
) -> bool
Inherited From VeSyncFryer
Start a cook from a recipe.
recipe.cook_mode must be one of the fryer's cook modes (see
get_cook_mode()); its API mode string is sent.
recipe.target_temp is converted from recipe.temp_unit to the
device unit, rounded to the mode's step and checked against its
limits. The times are checked as in set_mode(). A failed check
(including an invalid recipe.temp_unit) logs a warning and returns
False without a request. The recipe passed in is not changed.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
recipe
|
AirFryerPresetRecipe
|
The preset recipe to use. Its recipe ID, name and type are sent as given. |
required |
chamber
|
AirFryerChamber | int
|
The chamber to cook in. Default is
|
CHAMBER_1
|
Returns:
| Name | Type | Description |
|---|---|---|
bool |
bool
|
True if the command was successful, False otherwise. |
Note
Get a fryer's preset with get_mode_recipe() and change it with
dataclasses.replace. See
AirFryerPresetRecipe.
Source code in src/pyvesync/devices/vesynckitchen.py
set_mode
async
↲
set_mode(
cook_time: int,
cook_temp: int,
*,
temp_unit: TemperatureUnits | str | None = None,
preheat_time: int | None = None,
cook_mode: str | None = None,
chamber: AirFryerChamber | int = CHAMBER_1,
) -> bool
Inherited From VeSyncFryer
Start a cook with the given time and temperature.
cook_temp is converted to the device unit if needed, rounded to
the cook mode's step (see round_temperature()) and checked against
that mode's limits (see temp_limits()). Out of range logs a
warning and returns False without a request. On success the chamber
state is set locally from the request; call update() for the
device's reported state.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
cook_time
|
int
|
The cooking time in seconds, at least 1 (60 on
the CS137/CS158, whose API uses minutes and truncates to whole
minutes). A shorter time returns False without a request.
A mode's |
required |
cook_temp
|
int
|
The cooking temperature, in |
required |
temp_unit
|
TemperatureUnits | str | None
|
The unit of
|
None
|
preheat_time
|
int | None
|
The preheating time in seconds, if any.
Used only on fryers with the |
None
|
cook_mode
|
str | None
|
Cook mode to use, an |
None
|
chamber
|
AirFryerChamber | int
|
The chamber to cook in. Default is
|
CHAMBER_1
|
Returns:
| Name | Type | Description |
|---|---|---|
bool |
bool
|
True if the command was successful, False otherwise. |
Source code in src/pyvesync/devices/vesynckitchen.py
cook_from_preheat
async
↲
cook_from_preheat(
chamber: AirFryerChamber | int = CHAMBER_1,
) -> bool
Inherited From VeSyncFryer
Start cooking after the preheat has finished.
Only the CS137/CS158 (VeSyncAirFryer158) supports this; other
fryers return False without a request. The last known
cook_status must be PREHEAT_END, so call update() after
the preheat finishes; otherwise it returns False without a request.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
chamber
|
AirFryerChamber | int
|
The chamber to start cooking for.
Default is |
CHAMBER_1
|
Returns:
| Name | Type | Description |
|---|---|---|
bool |
bool
|
True if the command was successful, False otherwise. |
Source code in src/pyvesync/devices/vesynckitchen.py
pyvesync.devices.vesynckitchen.VeSyncTurboBlazeFryer ↲
Bases: BypassV2Mixin, VeSyncFryer
Cosori TurboBlaze air fryer (CAF-DC601S, bypassV2 startCook).
Single chamber; times are in seconds. A preheat is sent only when the
device map has the PREHEAT feature, otherwise preheat_time is
dropped with a debug log. stop(), resume() and
cook_from_preheat() are not implemented and return False. The reported
currentTemp is in Celsius and is converted to temp_unit. A local
set_mode() does not set state.recipe. A failed poll, an unknown
cookStatus or an out-of-range stepIndex leaves the state unchanged.
Source code in src/pyvesync/devices/vesynckitchen.py
483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 | |
get_details
async
↲
Inherited From VeSyncBaseDevice
Get device details.
This method is defined in each device class to contain
the logic to pull the device state from the API and update
the device's state attribute. The update() method should
be called to update the device state.
Source code in src/pyvesync/devices/vesynckitchen.py
end
async
↲
end(chamber: AirFryerChamber | int = CHAMBER_1) -> bool
Inherited From VeSyncFryer
End the current cooking or preheating session.
On success the chamber state is set to standby. On the CS137/CS158
the command depends on the last known state, and it returns False
without a request when that state is neither cooking nor preheating.
On the CAF-TF101S/TF102S, CHAMBER_1 during a whole-basket cook
(work_chamber WHOLE) ends the whole basket.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
chamber
|
AirFryerChamber | int
|
The chamber to end for. Default
is |
CHAMBER_1
|
Returns:
| Name | Type | Description |
|---|---|---|
bool |
bool
|
True if the command was successful, False otherwise. |
Source code in src/pyvesync/devices/vesynckitchen.py
set_mode_from_recipe
async
↲
set_mode_from_recipe(
recipe: AirFryerPresetRecipe,
*,
chamber: AirFryerChamber | int = CHAMBER_1,
) -> bool
Inherited From VeSyncFryer
Start a cook from a recipe.
recipe.cook_mode must be one of the fryer's cook modes (see
get_cook_mode()); its API mode string is sent.
recipe.target_temp is converted from recipe.temp_unit to the
device unit, rounded to the mode's step and checked against its
limits. The times are checked as in set_mode(). A failed check
(including an invalid recipe.temp_unit) logs a warning and returns
False without a request. The recipe passed in is not changed.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
recipe
|
AirFryerPresetRecipe
|
The preset recipe to use. Its recipe ID, name and type are sent as given. |
required |
chamber
|
AirFryerChamber | int
|
The chamber to cook in. Default is
|
CHAMBER_1
|
Returns:
| Name | Type | Description |
|---|---|---|
bool |
bool
|
True if the command was successful, False otherwise. |
Note
Get a fryer's preset with get_mode_recipe() and change it with
dataclasses.replace. See
AirFryerPresetRecipe.
Source code in src/pyvesync/devices/vesynckitchen.py
set_mode
async
↲
set_mode(
cook_time: int,
cook_temp: int,
*,
temp_unit: TemperatureUnits | str | None = None,
preheat_time: int | None = None,
cook_mode: str | None = None,
chamber: AirFryerChamber | int = CHAMBER_1,
) -> bool
Inherited From VeSyncFryer
Start a cook with the given time and temperature.
cook_temp is converted to the device unit if needed, rounded to
the cook mode's step (see round_temperature()) and checked against
that mode's limits (see temp_limits()). Out of range logs a
warning and returns False without a request. On success the chamber
state is set locally from the request; call update() for the
device's reported state.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
cook_time
|
int
|
The cooking time in seconds, at least 1 (60 on
the CS137/CS158, whose API uses minutes and truncates to whole
minutes). A shorter time returns False without a request.
A mode's |
required |
cook_temp
|
int
|
The cooking temperature, in |
required |
temp_unit
|
TemperatureUnits | str | None
|
The unit of
|
None
|
preheat_time
|
int | None
|
The preheating time in seconds, if any.
Used only on fryers with the |
None
|
cook_mode
|
str | None
|
Cook mode to use, an |
None
|
chamber
|
AirFryerChamber | int
|
The chamber to cook in. Default is
|
CHAMBER_1
|
Returns:
| Name | Type | Description |
|---|---|---|
bool |
bool
|
True if the command was successful, False otherwise. |
Source code in src/pyvesync/devices/vesynckitchen.py
pyvesync.devices.vesynckitchen.VeSyncDualBlazeFryer ↲
Bases: VeSyncTurboBlazeFryer
Cosori Dual Blaze Air Fryer Class (CAF-P583S).
Uses the TurboBlaze bypassV2 protocol with the request shape from the
CAF-P583S-KUS capture (2025-05-21): startCook data uses accountID
(not accountId) and sends hasLinkage False, and every payload
carries subDeviceNo and subDeviceType. The KEU variant has no
capture and is assumed to match. The P583S has no preheat, so
preheat_time is dropped with a debug log.
Source code in src/pyvesync/devices/vesynckitchen.py
pyvesync.devices.vesynckitchen.VeSyncDualAirFryer ↲
Bases: BypassV2Mixin, VeSyncFryer
Cosori Dual Air Fryer Class (CAF-TF101S, CAF-TF102S, CAF-DC111S).
Chambers are selected with AirFryerChamber:
CHAMBER_1/CHAMBER_2: one chamber (left/right on the TF101S/TF102S, upper/lower on the DC111S).WHOLE: the merged basket with the divider removed (TwinFry models only,WHOLE_CHAMBERfeature).BOTH: both chambers with identical settings, sent as the app's Sync mode (workChamber4,syncType2: both chambers finish together).
During a Sync cook with different times, the DC111S reports the chamber
that waits to start as AirFryerCookStatus.HOLD. Its wait counts down
only while the other chamber is cooking. set_chamber_modes() starts
a Sync cook with different settings per chamber, on fryers with the
CHAMBER_MODES feature; other fryers need the app or the fryer for that.
The device has no preheat, pause, or resume API: preheat_time and a
recipe's preheat_time are ignored, and stop() / resume()
return False. Pausing is handled physically by pulling the basket out,
which triggers a cookStop or pullOut state. Pushing the basket
back in resumes cooking automatically. The status has no temperature
reading, so current_temp stays None.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
details
|
ResponseDeviceDetailsModel
|
Device details. |
required |
manager
|
VeSync
|
Manager class. |
required |
feature_map
|
AirFryerMap
|
Device feature map. |
required |
Attributes:
| Name | Type | Description |
|---|---|---|
state_chamber_1 |
FryerState
|
State for chamber 1 (left) or whole. |
state_chamber_2 |
FryerState
|
State for chamber 2 (right). |
sync_chambers |
bool
|
Read-only. True only for the app's Sync mode
( |
work_chamber |
AirFryerChamber | None
|
Read-only. Chamber the device
reports as active ( |
A failed poll leaves both chamber states unchanged, apart from the
connection status and update time, which both chambers take from the
response. A chamber with an unknown cookStatus keeps its state.
Source code in src/pyvesync/devices/vesynckitchen.py
704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 | |
get_details
async
↲
Inherited From VeSyncBaseDevice
Get device details from the API.
Polls getAirfryerMultiStatus and updates state for each chamber.
Source code in src/pyvesync/devices/vesynckitchen.py
end
async
↲
end(chamber: AirFryerChamber | int = CHAMBER_1) -> bool
Inherited From VeSyncFryer
End the current cooking session.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
chamber
|
AirFryerChamber | int
|
Chamber to end. |
CHAMBER_1
|
Returns:
| Name | Type | Description |
|---|---|---|
bool |
bool
|
True on success, and the ended chamber state(s) are set to |
bool
|
standby. False without a request for an unsupported chamber. |
Source code in src/pyvesync/devices/vesynckitchen.py
stop
async
↲
stop(chamber: AirFryerChamber | int = CHAMBER_1) -> bool
Inherited From VeSyncFryer
Pause cooking in a chamber (pauseWork).
Needs the RESUMABLE feature. BOTH pauses both chambers in one
request. During a Sync cook the other chamber's HOLD wait stops
counting down too. The paused chamber reports cookStop and keeps
its remaining time.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
chamber
|
AirFryerChamber | int
|
Chamber to pause. |
CHAMBER_1
|
Returns:
| Name | Type | Description |
|---|---|---|
bool |
bool
|
True on success. |
Source code in src/pyvesync/devices/vesynckitchen.py
resume
async
↲
resume(chamber: AirFryerChamber | int = CHAMBER_1) -> bool
Inherited From VeSyncFryer
Resume a paused chamber (resumeWork).
Needs the RESUMABLE feature. BOTH resumes both chambers in one
request. The remaining time carries over.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
chamber
|
AirFryerChamber | int
|
Chamber to resume. |
CHAMBER_1
|
Returns:
| Name | Type | Description |
|---|---|---|
bool |
bool
|
True on success. |
Source code in src/pyvesync/devices/vesynckitchen.py
set_mode_from_recipe
async
↲
set_mode_from_recipe(
recipe: AirFryerPresetRecipe,
*,
chamber: AirFryerChamber | int = CHAMBER_1,
) -> bool
Inherited From VeSyncFryer
Start cooking with a preset recipe.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
recipe
|
AirFryerPresetRecipe
|
The preset recipe to use. Its |
required |
chamber
|
AirFryerChamber | int
|
Chamber to cook in. |
CHAMBER_1
|
Returns:
| Type | Description |
|---|---|
bool
|
True if the command was successful. |
Source code in src/pyvesync/devices/vesynckitchen.py
set_chamber_modes
async
↲
set_chamber_modes(
chamber_1: AirFryerPresetRecipe,
chamber_2: AirFryerPresetRecipe | None = None,
*,
sync_type: AirFryerSyncType = SYNC,
) -> bool
Inherited From VeSyncFryer
Start a recipe in each chamber, or one recipe in both.
Only fryers with the CHAMBER_MODES feature implement this. Both
recipes are checked before any request, as in
set_mode_from_recipe(), so an invalid second recipe does not start
the first. On success both chamber states are set locally from the
request; call update() for the device's reported state.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
chamber_1
|
AirFryerPresetRecipe
|
Recipe for chamber 1 with
|
required |
chamber_2
|
AirFryerPresetRecipe | None
|
Recipe for chamber 2.
Required with |
None
|
sync_type
|
AirFryerSyncType
|
|
SYNC
|
Returns:
| Name | Type | Description |
|---|---|---|
bool |
bool
|
True if the command was successful. An unsupported fryer or |
bool
|
an invalid combination returns False without a request. |
Source code in src/pyvesync/devices/vesynckitchen.py
set_mode
async
↲
set_mode(
cook_time: int,
cook_temp: int,
*,
temp_unit: TemperatureUnits | str | None = None,
preheat_time: int | None = None,
cook_mode: str | None = None,
chamber: AirFryerChamber | int = CHAMBER_1,
) -> bool
Inherited From VeSyncFryer
Set cooking mode with manual parameters.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
cook_time
|
int
|
Cooking time in seconds. |
required |
cook_temp
|
int
|
Cooking temperature, in |
required |
temp_unit
|
TemperatureUnits | str | None
|
Unit of |
None
|
preheat_time
|
int | None
|
Not used for this device. |
None
|
cook_mode
|
str | None
|
Cook mode, an |
None
|
chamber
|
AirFryerChamber | int
|
Chamber to cook in. |
CHAMBER_1
|
Returns:
| Type | Description |
|---|---|
bool
|
True if the command was successful. |
Source code in src/pyvesync/devices/vesynckitchen.py
pyvesync.base_devices.fryer_base.FryerState ↲
Bases: DeviceState
State class for Air Fryer devices.
Each FryerState instance represents a single cooking chamber. For single
chamber fryers, state is set to state_chamber_1. For dual chamber
fryers, state_chamber_1 and state_chamber_2 are used independently.
Times are in SECONDS, whatever the device's API uses; set_state()
converts API values with the device's convert_time_for_state().
Temperatures are in the device's temp_unit.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
device
|
VeSyncFryer
|
The device object. |
required |
details
|
ResponseDeviceDetailsModel
|
The device details. |
required |
feature_map
|
AirFryerMap
|
The feature map for the device. |
required |
Attributes:
| Name | Type | Description |
|---|---|---|
active_time |
int
|
Active time of device, defaults to None. |
connection_status |
str
|
Connection status of device. |
device |
VeSyncFryer
|
Device object. |
device_status |
str
|
Device status. |
features |
list[str]
|
|
time_units |
TimeUnits
|
The time unit of the device's API. State times are always in seconds. |
cook_status |
AirFryerCookStatus | None
|
The current cooking status. |
cook_mode |
str | None
|
The API mode string of the current cook (for
example |
temp_unit |
TemperatureUnits
|
Unit for all temperatures in this state
(read-through to the device's |
current_temp |
int | None
|
The current temperature in |
cook_set_temp |
int | None
|
The set cooking temperature in |
cook_set_time |
int | None
|
The set cooking time in seconds. |
cook_last_time |
int | None
|
The remaining cooking time in seconds at
the last update or command. |
last_timestamp |
datetime | None
|
When the remaining times were last
refreshed. Set each time |
preheat_set_time |
int | None
|
The set preheating time in seconds. |
preheat_last_time |
int | None
|
The remaining preheating time in
seconds at the last update or command. |
total_last_time |
int | None
|
Device-reported total remaining time (preheat plus cook) in seconds at the last update; None when the device does not report it (CS158) or after a local command until the next update. |
recipe |
str | None
|
The recipe name the device reports. A local command sets it only on dual-chamber fryers. |
ready_start |
bool
|
Not used by the library; always False. |
sync_chambers |
bool
|
True only when the device reports the app's Sync
mode ( |
work_chamber |
AirFryerChamber | None
|
Chamber the device reports as
active ( |
Note
Device classes call set_state() with the API response or the sent
request, set_standby() to clear the state, and the stop and
resume helpers for local pause and resume. Setting a running
cook_status (cooking, heating or hold) updates last_timestamp. A
failed or unreadable poll leaves the state unchanged.
Source code in src/pyvesync/base_devices/fryer_base.py
37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 | |
temp_unit
property
↲
temp_unit: TemperatureUnits
Return the unit for all temperatures in this state.
This is the device-level unit; all state temperatures
(current_temp, cook_set_temp) are expressed in this unit.
is_in_preheat_mode
property
↲
Return True if the fryer is in preheat mode.
A pulled-out basket counts as preheat only while preheat time remains.
is_preheating
property
↲
Return True if the fryer is currently running in preheat mode.
can_resume
property
↲
Return True if the status is paused (cook or preheat stop).
Only the CS137/CS158 implements resume().
cook_status
property
writable
↲
cook_status: AirFryerCookStatus | None
Return the current cooking status.
preheat_time_remaining
property
↲
Return the remaining preheat time in seconds.
cook_time_remaining
property
↲
Return the remaining cook time in seconds.
In HOLD (dual-chamber Sync cook), this is the wait before the
chamber starts cooking. It counts down only while the other chamber
cooks; with no last_timestamp it is the reported wait.
total_time_remaining
property
↲
Return the time until the cook finishes, in seconds.
This is the value the app's finish time uses. It comes from the
device's totalTimeRemaining where reported (counting down while
cooking, preheating, or in HOLD while the other chamber cooks),
else remaining preheat plus cook time. None in standby, and on the
CS158 during preheat after an update() (it reports no cook time
then).
set_standby ↲
Set the fryer state to standby and clear the cook values.
Clears the temperatures, times, recipe, preheat and
last_timestamp. cook_mode, sync_chambers and
work_chamber are kept.
This is to be called by device classes before updating the state from the API response to prevent stale data. The get_details API responses do not include all keys in every response depending on the status.
Source code in src/pyvesync/base_devices/fryer_base.py
set_cook_stop_state ↲
set_cook_stop_state(
cook_set_time: int | None = None,
cook_last_time: int | None = None,
total_last_time: int | None = None,
) -> None
Set the fryer state to cook stopped.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
cook_set_time
|
int | None
|
The cooking time in seconds. |
None
|
cook_last_time
|
int | None
|
The remaining cook time in seconds, as reported by the API. None freezes the live remaining time. |
None
|
total_last_time
|
int | None
|
The device-reported total remaining time in seconds, or None when not reported. |
None
|
Source code in src/pyvesync/base_devices/fryer_base.py
set_preheat_stop_state ↲
set_preheat_stop_state(
preheat_set_time: int | None = None,
preheat_last_time: int | None = None,
total_last_time: int | None = None,
) -> None
Set the fryer state to preheat stopped.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
preheat_set_time
|
int | None
|
The preheating time in seconds. |
None
|
preheat_last_time
|
int | None
|
The remaining preheat time in seconds, as reported by the API. None freezes the live remaining time. |
None
|
total_last_time
|
int | None
|
The device-reported total remaining time in seconds, or None when not reported. |
None
|
Source code in src/pyvesync/base_devices/fryer_base.py
set_preheat_resume_state ↲
Set the fryer state to preheat resumed.
The remaining preheat time carries over: a paused preheat resumes from its frozen value and a running one keeps counting down.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
preheat_set_time
|
int | None
|
The preheating time in seconds. |
None
|
Source code in src/pyvesync/base_devices/fryer_base.py
set_cook_resume_state ↲
Set the fryer state to cooking after a resume.
The remaining cook time carries over: a paused cook resumes from its frozen value and a running one keeps counting down.
Source code in src/pyvesync/base_devices/fryer_base.py
set_state ↲
set_state(
*,
cook_status: AirFryerCookStatus,
cook_time: int | None = None,
cook_last_time: int | None = None,
cook_temp: int | None = None,
cook_mode: str | None = None,
preheat_set_time: int | None = None,
preheat_last_time: int | None = None,
current_temp: int | None = None,
recipe: str | None = None,
total_last_time: int | None = None,
) -> None
Set the cook state from an API response or after a command.
Pass every value of the current cook state together. Time values are
in device units and are converted to seconds. STANDBY and the stop
statuses use the matching helpers. Otherwise a None cook_time,
cook_temp, cook_mode, current_temp or recipe keeps the
stored value; a None cook_last_time keeps it except while heating
(cleared); and a None preheat_set_time clears the preheat values
unless the status is a preheat status.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
cook_status
|
AirFryerCookStatus
|
The cooking status. |
required |
cook_time
|
int | None
|
The cooking time in device units. |
None
|
cook_last_time
|
int | None
|
The remaining cooking time in device units. |
None
|
cook_temp
|
int | None
|
The cooking temperature in the device's
|
None
|
cook_mode
|
str | None
|
The cooking mode. |
None
|
preheat_set_time
|
int | None
|
The preheating time in device units. |
None
|
preheat_last_time
|
int | None
|
The remaining preheat time in device units. |
None
|
current_temp
|
int | None
|
The current temperature in the device's
|
None
|
recipe
|
str | None
|
The recipe name or cooking mode. |
None
|
total_last_time
|
int | None
|
The device-reported total remaining time in device units. None (not reported, or a local command) clears the stored total. |
None
|
Source code in src/pyvesync/base_devices/fryer_base.py
408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 | |
pyvesync.base_devices.fryer_base.VeSyncFryer ↲
Bases: VeSyncBaseDevice[FryerState]
Base class for VeSync Air Fryer devices.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
details
|
ResponseDeviceDetailsModel
|
The device details. |
required |
manager
|
VeSync
|
The VeSync manager. |
required |
feature_map
|
AirFryerMap
|
The feature map for the device. |
required |
Attributes:
| Name | Type | Description |
|---|---|---|
state |
FryerState
|
The same object as |
last_response |
ResponseInfo
|
Last response from API call. |
manager |
VeSync
|
Manager object for API calls. |
device_name |
str
|
Name of device. |
device_image |
str
|
URL for device image. |
cid |
str
|
Device ID. |
connection_type |
str
|
Connection type of device. |
device_type |
str
|
Type of device. |
type |
str
|
Type of device. |
uuid |
str
|
UUID of device, not always present. |
config_module |
str
|
Configuration module of device. |
mac_id |
str
|
MAC ID of device. |
current_firm_version |
str
|
Current firmware version of device. |
latest_firm_version |
str | None
|
Latest firmware version of device. |
device_region |
str
|
Region of device. (US, EU, etc.) |
pid |
str | None
|
Product ID from |
sub_device_no |
int
|
Sub-device number of device. |
product_type |
str
|
Product type of device. |
features |
list[str]
|
|
status_map |
MappingProxyType
|
Mapping of API status strings to AirFryerCookStatus enums. |
cook_modes |
dict[str, AirFryerModeConfig]
|
The fryer's presets from the
device map, keyed by |
default_preset |
AirFryerPresetRecipe
|
This fryer's own copy of the
preset whose mode, recipe ID, name and type |
min_temp_f |
int
|
Lowest Fahrenheit temperature over all cook modes. |
max_temp_f |
int
|
Highest Fahrenheit temperature over all cook modes. |
min_temp_c |
int
|
Lowest Celsius temperature over all cook modes. |
max_temp_c |
int
|
Highest Celsius temperature over all cook modes. |
min_temp |
int
|
Lowest temperature over all cook modes, in the current
unit. A mode can have a narrower range; |
max_temp |
int
|
Highest temperature over all cook modes, in the
current unit (see |
state_chamber_1 |
FryerState
|
The state object for chamber 1. |
state_chamber_2 |
FryerState
|
The state object for chamber 2. It exists on every fryer, but only dual-chamber fryers update it. |
is_dual_chamber |
bool
|
True if the fryer has two chambers. |
supported_chambers |
tuple[AirFryerChamber, ...]
|
Chambers this fryer
accepts, derived from |
sync_chambers |
bool
|
Read-only. True only for the app's Sync mode
( |
work_chamber |
AirFryerChamber | None
|
Read-only. Chamber the device
reports as active ( |
temp_unit |
TemperatureUnits
|
The device's current temperature unit (seeded from the device map, updated from the API on update()). |
temperature_step |
int
|
The default mode's temperature step in the current unit. |
temperature_interval |
int
|
Deprecated alias of |
time_units |
TimeUnits
|
The time unit of the device's API (seconds or minutes). Every public time is in seconds. |
Source code in src/pyvesync/base_devices/fryer_base.py
520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 | |
cook_modes
instance-attribute
↲
cook_modes: dict[str, AirFryerModeConfig] = (
feature_map.cook_modes
)
Inherited From VeSyncFryer
pid
instance-attribute
↲
pid: str | None = AIRFRYER_PID_MAP.get(
details.configModule, None
)
Inherited From VeSyncBaseDevice
default_preset
instance-attribute
↲
default_preset: AirFryerPresetRecipe = replace(
feature_map.default_preset
)
Inherited From VeSyncFryer
state_chamber_1
instance-attribute
↲
state_chamber_1: FryerState = FryerState(
self, details, feature_map
)
Inherited From VeSyncFryer
state_chamber_2
instance-attribute
↲
state_chamber_2: FryerState = FryerState(
self, details, feature_map
)
Inherited From VeSyncFryer
time_units
instance-attribute
↲
time_units: TimeUnits = feature_map.time_units
Inherited From VeSyncFryer
temp_unit
property
writable
↲
temp_unit: TemperatureUnits
Inherited From VeSyncFryer
Return the temperature unit (F or C).
sync_chambers
property
↲
Inherited From VeSyncFryer
Return True if the chambers are in the app's Sync mode (read-only).
Set by update() and by local commands on dual-chamber fryers; see
the class attributes.
work_chamber
property
↲
work_chamber: AirFryerChamber | None
Inherited From VeSyncFryer
Return the chamber the device last reported as active (read-only).
supported_chambers
property
↲
supported_chambers: tuple[AirFryerChamber, ...]
Inherited From VeSyncFryer
Return the chambers this fryer accepts, in enum order.
Every fryer supports CHAMBER_1. DUAL_CHAMBER adds CHAMBER_2
and BOTH; WHOLE_CHAMBER adds WHOLE.
is_dual_chamber
property
↲
Inherited From VeSyncFryer
Return True if the fryer has two chambers.
min_temp_f
property
↲
Inherited From VeSyncFryer
Return the lowest Fahrenheit temperature over all cook modes.
max_temp_f
property
↲
Inherited From VeSyncFryer
Return the highest Fahrenheit temperature over all cook modes.
min_temp_c
property
↲
Inherited From VeSyncFryer
Return the lowest Celsius temperature over all cook modes.
max_temp_c
property
↲
Inherited From VeSyncFryer
Return the highest Celsius temperature over all cook modes.
temperature_step
property
↲
Inherited From VeSyncFryer
Return the default mode's temperature step in the current unit.
temperature_interval
property
↲
Inherited From VeSyncFryer
Return the default mode's temperature step in the current unit.
Deprecated
Use temperature_step instead.
min_temp
property
↲
Inherited From VeSyncFryer
Return the lowest temperature over all cook modes, in the current unit.
A mode can have a narrower range; temp_limits() gives the range
set_mode() accepts.
max_temp
property
↲
Inherited From VeSyncFryer
Return the highest temperature over all cook modes, in the current unit.
A mode can have a narrower range; temp_limits() gives the range
set_mode() accepts.
get_chamber_state ↲
get_chamber_state(
chamber: AirFryerChamber | int,
) -> FryerState | None
Inherited From VeSyncFryer
Return the state object for a chamber.
CHAMBER_1 and WHOLE map to state_chamber_1, CHAMBER_2
to state_chamber_2.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
chamber
|
AirFryerChamber | int
|
The chamber. |
required |
Returns:
| Type | Description |
|---|---|
FryerState | None
|
FryerState | None: The chamber's state, or None (after a debug |
FryerState | None
|
log) for |
FryerState | None
|
and |
FryerState | None
|
support or an invalid value. Never raises. |
Source code in src/pyvesync/base_devices/fryer_base.py
get_cook_mode ↲
get_cook_mode(
cook_mode: str | None = None,
) -> AirFryerModeConfig | None
Inherited From VeSyncFryer
Return the preset for a cook mode.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
cook_mode
|
str | None
|
An |
None
|
Returns:
| Type | Description |
|---|---|
AirFryerModeConfig | None
|
AirFryerModeConfig | None: The preset, or None if the fryer has no |
AirFryerModeConfig | None
|
such mode. |
Source code in src/pyvesync/base_devices/fryer_base.py
get_mode_recipe ↲
get_mode_recipe(
cook_mode: str | None = None,
) -> AirFryerPresetRecipe | None
Inherited From VeSyncFryer
Return a cook mode's preset as a recipe in the current unit.
Pass the result to set_mode_from_recipe(). Change its time or
temperature with dataclasses.replace first if needed. These are
the app's defaults for the mode, which can differ from
default_preset.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
cook_mode
|
str | None
|
As for |
None
|
Returns:
| Type | Description |
|---|---|
AirFryerPresetRecipe | None
|
AirFryerPresetRecipe | None: The recipe at the mode's default time |
AirFryerPresetRecipe | None
|
and temperature, or None if the fryer has no such mode. |
Source code in src/pyvesync/base_devices/fryer_base.py
temp_limits ↲
temp_limits(
cook_mode: str | None = None,
) -> AirFryerTempLimits
Inherited From VeSyncFryer
Return a cook mode's temperature limits in the current unit.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
cook_mode
|
str | None
|
As for |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
AirFryerTempLimits |
AirFryerTempLimits
|
The mode's minimum, maximum and step. |
Source code in src/pyvesync/base_devices/fryer_base.py
validate_temperature ↲
Inherited From VeSyncFryer
Validate the temperature is within the cook mode's range.
Checks the range only; off-step values are handled by rounding (see
round_temperature() and prepare_temperature()).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
temperature
|
int
|
The temperature in the device's |
required |
cook_mode
|
str | None
|
Cook mode whose limits apply, as for
|
None
|
Returns:
| Name | Type | Description |
|---|---|---|
bool |
bool
|
True if the temperature is valid, False otherwise. |
Source code in src/pyvesync/base_devices/fryer_base.py
round_temperature ↲
Inherited From VeSyncFryer
Round the temperature to the nearest step of the cook mode.
Uses Python's round(), so a value exactly halfway between two
steps goes to the even multiple (385 to 380 with a 10 degree step).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
temperature
|
int
|
The temperature in the device's |
required |
cook_mode
|
str | None
|
Cook mode whose step applies, as for
|
None
|
Returns:
| Name | Type | Description |
|---|---|---|
int |
int
|
The temperature rounded to the mode's step in the current |
int
|
unit. |
Source code in src/pyvesync/base_devices/fryer_base.py
prepare_temperature ↲
Inherited From VeSyncFryer
Round a requested temperature to the mode's step, then validate.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
temperature
|
int
|
Requested temperature in the device's
|
required |
cook_mode
|
str | None
|
Cook mode whose limits apply, as for
|
None
|
Returns:
| Type | Description |
|---|---|
int | None
|
int | None: The rounded temperature, or None (after a warning) if |
int | None
|
the rounded value is outside the mode's range for the current |
int | None
|
unit. |
Source code in src/pyvesync/base_devices/fryer_base.py
prepare_recipe_temperature ↲
prepare_recipe_temperature(
recipe: AirFryerPresetRecipe,
) -> int | None
Inherited From VeSyncFryer
Convert a recipe's temperature to the device unit, round and validate.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
recipe
|
AirFryerPresetRecipe
|
The recipe, whose |
required |
Returns:
| Type | Description |
|---|---|
int | None
|
int | None: The temperature in the device's |
int | None
|
to the mode's step, or None (after a warning) if it is outside the |
int | None
|
range of the recipe's |
int | None
|
fryer has no such mode), or if the temperature or |
int | None
|
|
Source code in src/pyvesync/base_devices/fryer_base.py
convert_time_for_api ↲
Inherited From VeSyncFryer
Convert time in seconds to the device's time units.
Minutes are truncated (int(seconds / 60)), so under 60 seconds
gives 0.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
time_in_seconds
|
int
|
The time in seconds. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
int |
int
|
The time converted to the device's time units. |
Source code in src/pyvesync/base_devices/fryer_base.py
convert_time_for_state ↲
Inherited From VeSyncFryer
Convert time in device's time units to seconds.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
time_in_device_units
|
int
|
The time in device's time units. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
int |
int
|
The time converted to seconds. |
Source code in src/pyvesync/base_devices/fryer_base.py
end
async
↲
end(chamber: AirFryerChamber | int = CHAMBER_1) -> bool
Inherited From VeSyncFryer
End the current cooking or preheating session.
On success the chamber state is set to standby. On the CS137/CS158
the command depends on the last known state, and it returns False
without a request when that state is neither cooking nor preheating.
On the CAF-TF101S/TF102S, CHAMBER_1 during a whole-basket cook
(work_chamber WHOLE) ends the whole basket.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
chamber
|
AirFryerChamber | int
|
The chamber to end for. Default
is |
CHAMBER_1
|
Returns:
| Name | Type | Description |
|---|---|---|
bool |
bool
|
True if the command was successful, False otherwise. |
Source code in src/pyvesync/base_devices/fryer_base.py
stop
async
↲
stop(chamber: AirFryerChamber | int = CHAMBER_1) -> bool
Inherited From VeSyncFryer
Stop (Pause) the current cooking or preheating session.
Supported by the CS137/CS158 (VeSyncAirFryer158) and dual fryers
with the RESUMABLE feature (CAF-DC111S-AEU); other fryers return
False without a request. The command is always sent:
the preheat stop when the last known state is a preheat phase,
otherwise the cook stop. Every successful command sets the state to
the phase it sent, so the next command picks the matching one.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
chamber
|
AirFryerChamber | int
|
The chamber to stop for. Default
is |
CHAMBER_1
|
Returns:
| Name | Type | Description |
|---|---|---|
bool |
bool
|
True if the command was successful, False otherwise. |
Source code in src/pyvesync/base_devices/fryer_base.py
resume
async
↲
resume(chamber: AirFryerChamber | int = CHAMBER_1) -> bool
Inherited From VeSyncFryer
Resume a paused cooking or preheating session.
Supported by the CS137/CS158 (VeSyncAirFryer158) and dual fryers
with the RESUMABLE feature (CAF-DC111S-AEU); other fryers return
False without a request. The command is always sent:
the preheat resume when the last known state is a preheat phase,
otherwise the cook resume. The remaining time carries over, so a
resume while running does not restart the countdown.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
chamber
|
AirFryerChamber | int
|
The chamber to resume for. Default
is |
CHAMBER_1
|
Returns:
| Name | Type | Description |
|---|---|---|
bool |
bool
|
True if the command was successful, False otherwise. |
Source code in src/pyvesync/base_devices/fryer_base.py
set_mode
async
↲
set_mode(
cook_time: int,
cook_temp: int,
*,
temp_unit: TemperatureUnits | str | None = None,
preheat_time: int | None = None,
cook_mode: str | None = None,
chamber: AirFryerChamber | int = CHAMBER_1,
) -> bool
Inherited From VeSyncFryer
Start a cook with the given time and temperature.
cook_temp is converted to the device unit if needed, rounded to
the cook mode's step (see round_temperature()) and checked against
that mode's limits (see temp_limits()). Out of range logs a
warning and returns False without a request. On success the chamber
state is set locally from the request; call update() for the
device's reported state.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
cook_time
|
int
|
The cooking time in seconds, at least 1 (60 on
the CS137/CS158, whose API uses minutes and truncates to whole
minutes). A shorter time returns False without a request.
A mode's |
required |
cook_temp
|
int
|
The cooking temperature, in |
required |
temp_unit
|
TemperatureUnits | str | None
|
The unit of
|
None
|
preheat_time
|
int | None
|
The preheating time in seconds, if any.
Used only on fryers with the |
None
|
cook_mode
|
str | None
|
Cook mode to use, an |
None
|
chamber
|
AirFryerChamber | int
|
The chamber to cook in. Default is
|
CHAMBER_1
|
Returns:
| Name | Type | Description |
|---|---|---|
bool |
bool
|
True if the command was successful, False otherwise. |
Source code in src/pyvesync/base_devices/fryer_base.py
set_chamber_modes
async
↲
set_chamber_modes(
chamber_1: AirFryerPresetRecipe,
chamber_2: AirFryerPresetRecipe | None = None,
*,
sync_type: AirFryerSyncType = SYNC,
) -> bool
Inherited From VeSyncFryer
Start a recipe in each chamber, or one recipe in both.
Only fryers with the CHAMBER_MODES feature implement this. Both
recipes are checked before any request, as in
set_mode_from_recipe(), so an invalid second recipe does not start
the first. On success both chamber states are set locally from the
request; call update() for the device's reported state.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
chamber_1
|
AirFryerPresetRecipe
|
Recipe for chamber 1 with
|
required |
chamber_2
|
AirFryerPresetRecipe | None
|
Recipe for chamber 2.
Required with |
None
|
sync_type
|
AirFryerSyncType
|
|
SYNC
|
Returns:
| Name | Type | Description |
|---|---|---|
bool |
bool
|
True if the command was successful. An unsupported fryer or |
bool
|
an invalid combination returns False without a request. |
Source code in src/pyvesync/base_devices/fryer_base.py
set_mode_from_recipe
async
↲
set_mode_from_recipe(
recipe: AirFryerPresetRecipe,
*,
chamber: AirFryerChamber | int = CHAMBER_1,
) -> bool
Inherited From VeSyncFryer
Start a cook from a recipe.
recipe.cook_mode must be one of the fryer's cook modes (see
get_cook_mode()); its API mode string is sent.
recipe.target_temp is converted from recipe.temp_unit to the
device unit, rounded to the mode's step and checked against its
limits. The times are checked as in set_mode(). A failed check
(including an invalid recipe.temp_unit) logs a warning and returns
False without a request. The recipe passed in is not changed.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
recipe
|
AirFryerPresetRecipe
|
The preset recipe to use. Its recipe ID, name and type are sent as given. |
required |
chamber
|
AirFryerChamber | int
|
The chamber to cook in. Default is
|
CHAMBER_1
|
Returns:
| Name | Type | Description |
|---|---|---|
bool |
bool
|
True if the command was successful, False otherwise. |
Note
Get a fryer's preset with get_mode_recipe() and change it with
dataclasses.replace. See
AirFryerPresetRecipe.
Source code in src/pyvesync/base_devices/fryer_base.py
cook_from_preheat
async
↲
cook_from_preheat(
chamber: AirFryerChamber | int = CHAMBER_1,
) -> bool
Inherited From VeSyncFryer
Start cooking after the preheat has finished.
Only the CS137/CS158 (VeSyncAirFryer158) supports this; other
fryers return False without a request. The last known
cook_status must be PREHEAT_END, so call update() after
the preheat finishes; otherwise it returns False without a request.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
chamber
|
AirFryerChamber | int
|
The chamber to start cooking for.
Default is |
CHAMBER_1
|
Returns:
| Name | Type | Description |
|---|---|---|
bool |
bool
|
True if the command was successful, False otherwise. |