Skip to content

feat: air fryer refactor#503

Open
webdjoe wants to merge 22 commits into
devfrom
air-fryer-refactor
Open

feat: air fryer refactor#503
webdjoe wants to merge 22 commits into
devfrom
air-fryer-refactor

Conversation

@webdjoe

@webdjoe webdjoe commented Jan 29, 2026

Copy link
Copy Markdown
Owner

No description provided.

@webdjoe webdjoe added the WIP label Jan 29, 2026

@cdnninja cdnninja left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Few thoughts. As well were is state for each chamber? Maybe I missed that.

Comment thread src/pyvesync/base_devices/fryer_base.py Outdated
Comment thread src/pyvesync/base_devices/fryer_base.py Outdated
Comment thread src/pyvesync/base_devices/fryer_base.py Outdated
@@ -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:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this file be called fryer vs kitchen?

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yea, should be separate from ovens or other kitchen devices.

class_name='VeSyncDualAirFryer',
module=vesynckitchen,
dev_types=['CAF-TF101S-AEU', 'CAF-TF101S'],
setup_entry='CAF-TF101S',

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@lackas

lackas commented Apr 26, 2026

Copy link
Copy Markdown

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.

@webdjoe

webdjoe commented May 23, 2026

Copy link
Copy Markdown
Owner Author

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?

@lackas

lackas commented May 23, 2026

Copy link
Copy Markdown

Confirmed. Running locally in HA via my custom integration component; both chambers behave as expected (status, temperature, remaining time). All good.

RedsGT and others added 3 commits July 12, 2026 00:10
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>
@webdjoe webdjoe changed the title [wip] feat: air fryer refactor feat: air fryer refactor Jul 12, 2026
@webdjoe webdjoe marked this pull request as ready for review July 12, 2026 18:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants