Skip to content

Commit

Permalink
Rollback previous changes regarding to RvcCleanMode
Browse files Browse the repository at this point in the history
  • Loading branch information
erwinpan1 committed Oct 2, 2023
1 parent 4d33670 commit a65fb76
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions examples/chef/common/chef-rvc-mode-delegate.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -130,13 +130,12 @@ CHIP_ERROR RvcCleanModeDelegate::Init()

void RvcCleanModeDelegate::HandleChangeToMode(uint8_t NewMode, ModeBase::Commands::ChangeToModeResponse::Type & response)
{
uint8_t rvcCleanCurrentMode = gRvcCleanModeInstance->GetCurrentMode();
uint8_t rvcRunCurrentMode = gRvcRunModeInstance->GetCurrentMode();

// An example to show how do we block mode change in some circumstance
if (rvcCleanCurrentMode == RvcCleanMode::ModeDeepClean)
if (rvcRunCurrentMode == RvcRunMode::ModeCleaning)
{
response.status = to_underlying(RvcCleanMode::StatusCode::kCleaningInProgress);
response.statusText.SetValue(chip::CharSpan::fromCharString("Cannot change the cleaning mode during a deep clean"));
response.statusText.SetValue(chip::CharSpan::fromCharString("Cannot change the cleaning mode during a clean"));
return;
}

Expand Down

0 comments on commit a65fb76

Please sign in to comment.