mirror of
https://github.com/esphome/esphome.git
synced 2026-09-30 00:10:22 +00:00
[gree] Remove the traits() override now handled by climate_ir (#19484)
This commit is contained in:
@@ -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"]
|
||||
@@ -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
|
||||
Reference in New Issue
Block a user