mirror of
https://github.com/esphome/esphome.git
synced 2025-11-01 07:31:51 +00:00
fixed
This commit is contained in:
@@ -1,8 +1,7 @@
|
|||||||
#include <utility>
|
|
||||||
#include "esphome/core/helpers.h"
|
|
||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
|
#include "esphome/core/helpers.h"
|
||||||
|
|
||||||
namespace esphome {
|
namespace esphome {
|
||||||
|
|
||||||
#ifdef USE_API
|
#ifdef USE_API
|
||||||
@@ -43,14 +42,11 @@ class FanTraits {
|
|||||||
void set_direction(bool direction) { this->direction_ = direction; }
|
void set_direction(bool direction) { this->direction_ = direction; }
|
||||||
/// Return the preset modes supported by the fan.
|
/// Return the preset modes supported by the fan.
|
||||||
const FixedVector<std::string> &supported_preset_modes() const { return *this->preset_modes_; }
|
const FixedVector<std::string> &supported_preset_modes() const { return *this->preset_modes_; }
|
||||||
/// Set the preset modes pointer (points to parent Fan's preset_modes_)
|
|
||||||
void set_supported_preset_modes(const FixedVector<std::string> *preset_modes) { this->preset_modes_ = preset_modes; }
|
|
||||||
/// Return if preset modes are supported
|
/// Return if preset modes are supported
|
||||||
bool supports_preset_modes() const { return !this->preset_modes_->empty(); }
|
bool supports_preset_modes() const { return !this->preset_modes_->empty(); }
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
#ifdef USE_API
|
#ifdef USE_API
|
||||||
// The API connection is a friend class to access internal methods
|
|
||||||
friend class api::APIConnection;
|
friend class api::APIConnection;
|
||||||
// This method returns a reference to the internal preset modes.
|
// This method returns a reference to the internal preset modes.
|
||||||
// It is used by the API to avoid copying data when encoding messages.
|
// It is used by the API to avoid copying data when encoding messages.
|
||||||
|
|||||||
Reference in New Issue
Block a user