Repository navigation
fix: TurboBlaze fryer preheat state after set_mode and on pullOut - #560
Open
ScribleSean wants to merge 1 commit into
Open
ScribleSean wants to merge 1 commit into
ScribleSean wants to merge 1 commit into
Conversation
set_mode_from_recipe set the local status to COOKING even when the program starts with a preheat, so the state read as cooking until the next update. get_details passed preheatSetTime through as 0 when the program has no preheat. FryerState tests for None, so a basket pulled during a cook read as being in preheat mode.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Two small state fixes for
VeSyncTurboBlazeFryer, against the air fryer refactor in #503. I ran into both while testing a CS358-AF for #557.1.
set_modewith preheat leaves the state asCOOKINGset_mode_from_recipealways set the local status toCOOKING. When the recipe has a preheat time the unit starts in the preheat phase, so until the nextupdate()the state was wrong:is_in_preheat_modewasFalseandcook_from_preheat()could not see the preheat.It now sets
HEATINGwhen the recipe has a preheat time, andCOOKINGotherwise.2. A basket pulled during a cook reads as preheat
getAirfryerStatusreportspreheatSetTimeas0when the program has no preheat.get_detailspassed that0straight toset_state.FryerState.is_in_preheat_modeandis_in_cook_modetest forNone, so apullOutduring a plain cook gaveis_in_preheat_mode=Trueandis_in_cook_mode=False.get_detailsnow passesNonefor both preheat times whenpreheatSetTimeis0.Tests
src/tests/test_fryer_turboblaze_state.py, using the CAF-DC601S test data:set_modewith a preheat time ends inHEATINGand preheat modeset_modewithout one ends inCOOKINGpullOutwithpreheatSetTime0 is cook modepullOutwith a preheat time set is preheat modeThe first and third fail without the fix.
pytest src/tests: all pass locally.ruff checkandruff format --checkare clean.Not covered
On my CS358-AF, a cook that follows a preheat still reports the original
preheatSetTimewhile cooking, withpreheatLastTimeat 0. A basket pulled in that phase is still classified as preheat. Telling it apart from a pull atpreheatEndneeds more than these two fields, so I left it out.I only have a CS358-AF. The
0forpreheatSetTimematches the existing CAF-DC601S test data, but I could not check the behaviour on that model's hardware.