mirror of
https://github.com/esphome/esphome.git
synced 2026-09-28 15:30:21 +00:00
25 lines
800 B
C++
25 lines
800 B
C++
#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
|