feat: air fryer refactor#503
Conversation
for more information, see https://pre-commit.ci
cdnninja
left a comment
There was a problem hiding this comment.
Few thoughts. As well were is state for each chamber? Maybe I missed that.
| @@ -12,32 +12,33 @@ | |||
| necessary to maintain state, especially when trying to `pause` or `resume` the device. | |||
| Defaults to 60 seconds but can be set via: | |||
|
|
|||
There was a problem hiding this comment.
Should this file be called fryer vs kitchen?
There was a problem hiding this comment.
Yea, should be separate from ovens or other kitchen devices.
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
| class_name='VeSyncDualAirFryer', | ||
| module=vesynckitchen, | ||
| dev_types=['CAF-TF101S-AEU', 'CAF-TF101S'], | ||
| setup_entry='CAF-TF101S', |
There was a problem hiding this comment.
Tested: The newer CAF-TF102S (Dual Blaze TwinFry 10L, EU) also works with VeSyncDualAirFryer — status, dual chambers, cook modes all confirmed. Suggest adding 'CAF-TF102S' here.
|
Added CAF-TF102S (Cosori Dual Blaze TwinFry 10L) support on top of this branch: lackas/pyvesync@e86d102 We also built a custom HA integration component with dual-chamber sensor entities (per-zone cook status, temperature, remaining time) based on this refactor: https://github.com/lackas/ha-core/tree/vesync-air-fryer Both have been running in production. Happy to help get this over the finish line if needed. |
|
Hi @lackas thank you for the support! I just want to confirm that you successfully used this PR with the dual blaze? Everything is working as it should? |
|
Confirmed. Running locally in HA via my custom integration component; both chambers behave as expected (status, temperature, remaining time). All good. |
Adds support for the Cosori Dual Blaze 6.8qt smart air fryer (CAF-P583S-KUS / CAF-P583S-KEU). Resolves the request in #477. The Dual Blaze is a single-chamber model with dual heating elements that uses the same bypassV2 protocol as TurboBlaze (`startCook`, `endCook`, `getAirfryerStatus`), so it can reuse `VeSyncTurboBlazeFryer` without needing a new device class. ## Commits 1. **Register CAF-P583S** in `device_map.py` (basic support, default AirFry preset). 2. **Add 10 Dual Blaze presets + 5 cook modes** — recipe IDs from packet captures of the official VeSync app, default temp/time per the CAF-P583S-KUS user manual. ## Tested on - CAF-P583S-KUS, firmware v1.0.15 - Verified: remote start, remote stop, status polling (cookStatus, currentTemp, cookSetTemp, totalTimeRemaining, stepArray), all 11 presets accepted by the device ## Notes - The Dual Blaze has no preheat function. - Temperature range per manual: 175–400°F / 80–205°C. 🤖 The patches in this PR were authored with assistance from Claude (Anthropic). --------- Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com> Co-authored-by: Joe Trabulsy <jtrabulsy@gmail.com> Co-authored-by: Darren Griffin <darren.griffin@live.co.uk>
…nits All air fryer temperatures (method arguments, state, and API payloads) are now consistently expressed in the device's own unit, with the device map as the single source of truth for each model's unit and step. - AirFryerMap gains a temp_unit field that seeds VeSyncFryer._temp_unit at init, replacing the country-code guess. The API-reported tempUnit still wins: each device's get_details sets device.temp_unit explicitly from the response, and FryerState.set_state no longer mutates device-level config. - The map declares a single Fahrenheit step (temperature_step_f); the Celsius step is derived from AIRFRYER_STEP_F_TO_C (5F -> 2C, 10F -> 5C) via a new temperature_step_c property, and temperature_step/min_temp/max_temp select by the device's current unit. round_temperature uses the declared step, dropping the imprecise 5/9-derived Celsius rounding. - The Dual Blaze is split into US (CAF-P583S, Fahrenheit) and EU (CAF-P583S-KEU, Celsius) entries so each device type declares one unit. - set_mode rounds-then-validates via a shared prepare_temperature helper, adding the validation TurboBlaze previously skipped and fixing validate-before-round edge cases. - FryerState exposes temp_unit as a read-through property; docstrings document that all temperatures are in the device's current unit. Adds src/tests/test_fryer_units.py covering unit seeding, API-wins updates, unit-aware steps/ranges, the F-to-C step map, and round-then-validate. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
No description provided.