[gree] Remove the traits() override now handled by climate_ir (#19484)

This commit is contained in:
Leonardo Rivera
2026-09-23 16:29:23 +01:00
committed by GitHub
parent 26abc1325e
commit 93df1e1259
4 changed files with 30 additions and 12 deletions
+6
View File
@@ -0,0 +1,6 @@
from tests.testing_helpers import ComponentManifestOverride
def override_manifest(manifest: ComponentManifestOverride) -> None:
# AUTO_LOAD sits on the climate platform, which the unit test build does not load.
manifest.dependencies = manifest.dependencies + ["climate_ir", "climate"]
+24
View File
@@ -0,0 +1,24 @@
#include <gtest/gtest.h>
#include "esphome/components/gree/gree.h"
namespace esphome::gree::testing {
TEST(GreeClimateTest, HeatCoolHiddenWithoutHeatByDefault) {
GreeClimate climate;
climate.set_supports_heat(false);
climate.set_supports_cool(true);
climate.set_supports_heat_cool(false);
EXPECT_FALSE(climate.get_traits().supports_mode(climate::CLIMATE_MODE_HEAT_COOL));
}
TEST(GreeClimateTest, HeatCoolOverrideAdvertisedWithoutHeat) {
GreeClimate climate;
climate.set_supports_heat(false);
climate.set_supports_cool(true);
climate.set_supports_heat_cool(true);
auto traits = climate.get_traits();
EXPECT_TRUE(traits.supports_mode(climate::CLIMATE_MODE_HEAT_COOL));
EXPECT_FALSE(traits.supports_mode(climate::CLIMATE_MODE_HEAT));
}
} // namespace esphome::gree::testing