ESPHome  2022.11.3
Public Member Functions | Protected Attributes
esphome::number::NumberTraits Class Reference

#include <number_traits.h>

Public Member Functions

void set_min_value (float min_value)
 
float get_min_value () const
 
void set_max_value (float max_value)
 
float get_max_value () const
 
void set_step (float step)
 
float get_step () const
 
void set_unit_of_measurement (const std::string &unit_of_measurement)
 Manually set the unit of measurement. More...
 
std::string get_unit_of_measurement ()
 Get the unit of measurement, using the manual override if set. More...
 
void set_mode (NumberMode mode)
 
NumberMode get_mode () const
 

Protected Attributes

float min_value_ = NAN
 
float max_value_ = NAN
 
float step_ = NAN
 
optional< std::string > unit_of_measurement_
 Unit of measurement override. More...
 
NumberMode mode_ {NUMBER_MODE_AUTO}
 

Detailed Description

Definition at line 14 of file number_traits.h.

Member Function Documentation

◆ get_max_value()

float esphome::number::NumberTraits::get_max_value ( ) const
inline

Definition at line 20 of file number_traits.h.

◆ get_min_value()

float esphome::number::NumberTraits::get_min_value ( ) const
inline

Definition at line 18 of file number_traits.h.

◆ get_mode()

NumberMode esphome::number::NumberTraits::get_mode ( ) const
inline

Definition at line 33 of file number_traits.h.

◆ get_step()

float esphome::number::NumberTraits::get_step ( ) const
inline

Definition at line 24 of file number_traits.h.

◆ get_unit_of_measurement()

std::string esphome::number::NumberTraits::get_unit_of_measurement ( )

Get the unit of measurement, using the manual override if set.

Definition at line 13 of file number_traits.cpp.

◆ set_max_value()

void esphome::number::NumberTraits::set_max_value ( float  max_value)
inline

Definition at line 19 of file number_traits.h.

◆ set_min_value()

void esphome::number::NumberTraits::set_min_value ( float  min_value)
inline

Definition at line 17 of file number_traits.h.

◆ set_mode()

void esphome::number::NumberTraits::set_mode ( NumberMode  mode)
inline

Definition at line 32 of file number_traits.h.

◆ set_step()

void esphome::number::NumberTraits::set_step ( float  step)
inline

Definition at line 23 of file number_traits.h.

◆ set_unit_of_measurement()

void esphome::number::NumberTraits::set_unit_of_measurement ( const std::string &  unit_of_measurement)

Manually set the unit of measurement.

Definition at line 9 of file number_traits.cpp.

Field Documentation

◆ max_value_

float esphome::number::NumberTraits::max_value_ = NAN
protected

Definition at line 37 of file number_traits.h.

◆ min_value_

float esphome::number::NumberTraits::min_value_ = NAN
protected

Definition at line 36 of file number_traits.h.

◆ mode_

NumberMode esphome::number::NumberTraits::mode_ {NUMBER_MODE_AUTO}
protected

Definition at line 40 of file number_traits.h.

◆ step_

float esphome::number::NumberTraits::step_ = NAN
protected

Definition at line 38 of file number_traits.h.

◆ unit_of_measurement_

optional<std::string> esphome::number::NumberTraits::unit_of_measurement_
protected

Unit of measurement override.

Definition at line 39 of file number_traits.h.


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