ESPHome
2024.10.2
|
Base-class for all numbers. More...
#include <number.h>
Public Member Functions | |
void | publish_state (float state) |
NumberCall | make_call () |
void | add_on_state_callback (std::function< void(float)> &&callback) |
bool | has_state () const |
Return whether this number has gotten a full state yet. More... | |
Public Member Functions inherited from esphome::EntityBase | |
const StringRef & | get_name () const |
void | set_name (const char *name) |
bool | has_own_name () const |
std::string | get_object_id () const |
void | set_object_id (const char *object_id) |
uint32_t | get_object_id_hash () |
bool | is_internal () const |
void | set_internal (bool internal) |
bool | is_disabled_by_default () const |
void | set_disabled_by_default (bool disabled_by_default) |
EntityCategory | get_entity_category () const |
void | set_entity_category (EntityCategory entity_category) |
std::string | get_icon () const |
void | set_icon (const char *icon) |
Data Fields | |
float | state |
NumberTraits | traits |
Protected Member Functions | |
virtual void | control (float value)=0 |
Set the value of the number, this is a virtual method that each number integration must implement. More... | |
Protected Member Functions inherited from esphome::EntityBase | |
virtual uint32_t | hash_base () |
The hash_base() function has been deprecated. More... | |
void | calc_object_id_ () |
Protected Attributes | |
CallbackManager< void(float)> | state_callback_ |
bool | has_state_ {false} |
Protected Attributes inherited from esphome::EntityBase | |
StringRef | name_ |
const char * | object_id_c_str_ {nullptr} |
const char * | icon_c_str_ {nullptr} |
uint32_t | object_id_hash_ |
bool | has_own_name_ {false} |
bool | internal_ {false} |
bool | disabled_by_default_ {false} |
EntityCategory | entity_category_ {ENTITY_CATEGORY_NONE} |
Base-class for all numbers.
A number can use publish_state to send out a new value.
void esphome::number::Number::add_on_state_callback | ( | std::function< void(float)> && | callback | ) |
Definition at line 16 of file number.cpp.
|
protectedpure virtual |
Set the value of the number, this is a virtual method that each number integration must implement.
This method is called by the NumberCall.
value | The value as validated by the NumberCall. |
Implemented in esphome::sprinkler::SprinklerControllerNumber, esphome::ld2420::LD2420MoveThresholdNumbers, esphome::ld2420::LD2420StillThresholdNumbers, esphome::ld2420::LD2420StillSensFactorNumber, esphome::ld2420::LD2420MoveSensFactorNumber, esphome::modbus_controller::ModbusNumber, esphome::ld2420::LD2420GateSelectNumber, esphome::demo::DemoNumber, esphome::ld2420::LD2420MaxDistanceNumber, esphome::homeassistant::HomeassistantNumber, esphome::template_::TemplateNumber, esphome::tuya::TuyaNumber, esphome::lvgl::LVGLNumber, esphome::ld2420::LD2420MinDistanceNumber, esphome::copy::CopyNumber, esphome::ld2410::GateThresholdNumber, esphome::ld2410::LightThresholdNumber, esphome::ld2410::MaxDistanceTimeoutNumber, esphome::ld2420::LD2420TimeoutNumber, esphome::micronova::MicroNovaNumber, esphome::seeed_mr24hpc1::CustomModeNumber, esphome::seeed_mr24hpc1::CustomUnmanTimeNumber, esphome::seeed_mr24hpc1::ExistenceThresholdNumber, esphome::seeed_mr24hpc1::MotionThresholdNumber, esphome::seeed_mr24hpc1::MotionTriggerTimeNumber, esphome::seeed_mr24hpc1::MotionToRestTimeNumber, and esphome::seeed_mr24hpc1::SensitivityNumber.
|
inline |
|
inline |
void esphome::number::Number::publish_state | ( | float | state | ) |
Definition at line 9 of file number.cpp.
|
protected |
NumberTraits esphome::number::Number::traits |