1
0
mirror of https://github.com/esphome/esphome.git synced 2025-10-31 15:12:06 +00:00
This commit is contained in:
J. Nick Koston
2025-10-30 10:55:06 -05:00
parent bf1514e672
commit 8f9f00df83

View File

@@ -131,6 +131,9 @@ class ClimateTraits {
void set_supported_custom_fan_modes(const std::vector<const char *> &modes) {
this->supported_custom_fan_modes_ = modes;
}
template<size_t N> void set_supported_custom_fan_modes(const char *const (&modes)[N]) {
this->supported_custom_fan_modes_.assign(modes, modes + N);
}
const std::vector<const char *> &get_supported_custom_fan_modes() const { return this->supported_custom_fan_modes_; }
bool supports_custom_fan_mode(const std::string &custom_fan_mode) const {
for (const char *mode : this->supported_custom_fan_modes_) {
@@ -152,6 +155,9 @@ class ClimateTraits {
void set_supported_custom_presets(const std::vector<const char *> &presets) {
this->supported_custom_presets_ = presets;
}
template<size_t N> void set_supported_custom_presets(const char *const (&presets)[N]) {
this->supported_custom_presets_.assign(presets, presets + N);
}
const std::vector<const char *> &get_supported_custom_presets() const { return this->supported_custom_presets_; }
bool supports_custom_preset(const std::string &custom_preset) const {
for (const char *preset : this->supported_custom_presets_) {