Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use the correct string for Fan mode in Home Assistant. #1657

Merged
merged 1 commit into from
Oct 29, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/IRac.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3385,7 +3385,7 @@ String IRac::opmodeToString(const stdAc::opmode_t mode, const bool ha) {
case stdAc::opmode_t::kCool: return kCoolStr;
case stdAc::opmode_t::kHeat: return kHeatStr;
case stdAc::opmode_t::kDry: return kDryStr;
case stdAc::opmode_t::kFan: return ha ? kFanOnlyStr : kFanStr;
case stdAc::opmode_t::kFan: return ha ? kFan_OnlyStr : kFanStr;
default: return kUnknownStr;
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/IRtext.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ IRTEXT_CONST_STRING(kFanStr, D_STR_FAN); ///< "Fan"
// HomeAssistant & Google Home Climate integration. For compatibility only.
// Ref: https://www.home-assistant.io/integrations/google_assistant/#climate-operation-modes
IRTEXT_CONST_STRING(kFanOnlyStr, D_STR_FANONLY); ///< "fan-only"
IRTEXT_CONST_STRING(kFan_OnlyStr, D_STR_FAN_ONLY); ///< "fan_only" (legacy)
IRTEXT_CONST_STRING(kFan_OnlyStr, D_STR_FAN_ONLY); ///< "fan_only" (HA/legacy)
IRTEXT_CONST_STRING(kFanOnlyWithSpaceStr, D_STR_FANSPACEONLY); ///< "Fan Only"
IRTEXT_CONST_STRING(kFanOnlyNoSpaceStr, D_STR_FANONLYNOSPACE); ///< "FanOnly"

Expand Down
2 changes: 1 addition & 1 deletion test/IRac_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2347,7 +2347,7 @@ TEST(TestIRac, opmodeToString) {
EXPECT_EQ("UNKNOWN", IRac::opmodeToString((stdAc::opmode_t)500));
// Home Assistant/Google Home differences.
EXPECT_EQ("Fan", IRac::opmodeToString(stdAc::opmode_t::kFan, false));
EXPECT_EQ("fan-only", IRac::opmodeToString(stdAc::opmode_t::kFan, true));
EXPECT_EQ("fan_only", IRac::opmodeToString(stdAc::opmode_t::kFan, true));
EXPECT_EQ("Fan", IRac::opmodeToString(stdAc::opmode_t::kFan)); // Default
}

Expand Down