ESPHome  2024.11.0
Public Member Functions | Protected Attributes
esphome::fan::FanTraits Class Reference

#include <fan_traits.h>

Public Member Functions

 FanTraits ()=default
 
 FanTraits (bool oscillation, bool speed, bool direction, int speed_count)
 
bool supports_oscillation () const
 Return if this fan supports oscillation. More...
 
void set_oscillation (bool oscillation)
 Set whether this fan supports oscillation. More...
 
bool supports_speed () const
 Return if this fan supports speed modes. More...
 
void set_speed (bool speed)
 Set whether this fan supports speed levels. More...
 
int supported_speed_count () const
 Return how many speed levels the fan has. More...
 
void set_supported_speed_count (int speed_count)
 Set how many speed levels this fan has. More...
 
bool supports_direction () const
 Return if this fan supports changing direction. More...
 
void set_direction (bool direction)
 Set whether this fan supports changing direction. More...
 
std::set< std::string > supported_preset_modes () const
 Return the preset modes supported by the fan. More...
 
void set_supported_preset_modes (const std::set< std::string > &preset_modes)
 Set the preset modes supported by the fan. More...
 
bool supports_preset_modes () const
 Return if preset modes are supported. More...
 

Protected Attributes

bool oscillation_ {false}
 
bool speed_ {false}
 
bool direction_ {false}
 
int speed_count_ {}
 
std::set< std::string > preset_modes_ {}
 

Detailed Description

Definition at line 9 of file fan_traits.h.

Constructor & Destructor Documentation

◆ FanTraits() [1/2]

esphome::fan::FanTraits::FanTraits ( )
default

◆ FanTraits() [2/2]

esphome::fan::FanTraits::FanTraits ( bool  oscillation,
bool  speed,
bool  direction,
int  speed_count 
)
inline

Definition at line 12 of file fan_traits.h.

Member Function Documentation

◆ set_direction()

void esphome::fan::FanTraits::set_direction ( bool  direction)
inline

Set whether this fan supports changing direction.

Definition at line 30 of file fan_traits.h.

◆ set_oscillation()

void esphome::fan::FanTraits::set_oscillation ( bool  oscillation)
inline

Set whether this fan supports oscillation.

Definition at line 18 of file fan_traits.h.

◆ set_speed()

void esphome::fan::FanTraits::set_speed ( bool  speed)
inline

Set whether this fan supports speed levels.

Definition at line 22 of file fan_traits.h.

◆ set_supported_preset_modes()

void esphome::fan::FanTraits::set_supported_preset_modes ( const std::set< std::string > &  preset_modes)
inline

Set the preset modes supported by the fan.

Definition at line 34 of file fan_traits.h.

◆ set_supported_speed_count()

void esphome::fan::FanTraits::set_supported_speed_count ( int  speed_count)
inline

Set how many speed levels this fan has.

Definition at line 26 of file fan_traits.h.

◆ supported_preset_modes()

std::set<std::string> esphome::fan::FanTraits::supported_preset_modes ( ) const
inline

Return the preset modes supported by the fan.

Definition at line 32 of file fan_traits.h.

◆ supported_speed_count()

int esphome::fan::FanTraits::supported_speed_count ( ) const
inline

Return how many speed levels the fan has.

Definition at line 24 of file fan_traits.h.

◆ supports_direction()

bool esphome::fan::FanTraits::supports_direction ( ) const
inline

Return if this fan supports changing direction.

Definition at line 28 of file fan_traits.h.

◆ supports_oscillation()

bool esphome::fan::FanTraits::supports_oscillation ( ) const
inline

Return if this fan supports oscillation.

Definition at line 16 of file fan_traits.h.

◆ supports_preset_modes()

bool esphome::fan::FanTraits::supports_preset_modes ( ) const
inline

Return if preset modes are supported.

Definition at line 36 of file fan_traits.h.

◆ supports_speed()

bool esphome::fan::FanTraits::supports_speed ( ) const
inline

Return if this fan supports speed modes.

Definition at line 20 of file fan_traits.h.

Field Documentation

◆ direction_

bool esphome::fan::FanTraits::direction_ {false}
protected

Definition at line 41 of file fan_traits.h.

◆ oscillation_

bool esphome::fan::FanTraits::oscillation_ {false}
protected

Definition at line 39 of file fan_traits.h.

◆ preset_modes_

std::set<std::string> esphome::fan::FanTraits::preset_modes_ {}
protected

Definition at line 43 of file fan_traits.h.

◆ speed_

bool esphome::fan::FanTraits::speed_ {false}
protected

Definition at line 40 of file fan_traits.h.

◆ speed_count_

int esphome::fan::FanTraits::speed_count_ {}
protected

Definition at line 42 of file fan_traits.h.


The documentation for this class was generated from the following file: