ESPHome  2022.12.8
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
void set_device_class (const std::string &device_class)
std::string get_device_class ()

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}
optional< std::string > device_class_

Detailed Description

Definition at line 14 of file number_traits.h.

Member Function Documentation

◆ get_device_class()

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

Definition at line 21 of file number_traits.cpp.

◆ get_max_value()

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

Definition at line 20 of file number_traits.h.

◆ get_min_value()

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

Definition at line 18 of file number_traits.h.

◆ get_mode()

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

Definition at line 33 of file number_traits.h.

◆ get_step()

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

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_device_class()

void esphome::number::NumberTraits::set_device_class ( const std::string &  device_class)

Definition at line 19 of file number_traits.cpp.

◆ set_max_value()

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

Definition at line 19 of file number_traits.h.

◆ set_min_value()

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

Definition at line 17 of file number_traits.h.

◆ set_mode()

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

Definition at line 32 of file number_traits.h.

◆ set_step()

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

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

◆ device_class_

optional<std::string> esphome::number::NumberTraits::device_class_

Definition at line 45 of file number_traits.h.

◆ max_value_

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

Definition at line 41 of file number_traits.h.

◆ min_value_

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

Definition at line 40 of file number_traits.h.

◆ mode_

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

Definition at line 44 of file number_traits.h.

◆ step_

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

Definition at line 42 of file number_traits.h.

◆ unit_of_measurement_

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

Unit of measurement override.

Definition at line 43 of file number_traits.h.

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