12 #define LOG_NUMBER(prefix, type, obj) \ 13 if ((obj) != nullptr) { \ 14 ESP_LOGCONFIG(TAG, "%s%s '%s'", prefix, LOG_STR_LITERAL(type), (obj)->get_name().c_str()); \ 15 if (!(obj)->get_icon().empty()) { \ 16 ESP_LOGCONFIG(TAG, "%s Icon: '%s'", prefix, (obj)->get_icon().c_str()); \ 18 if (!(obj)->traits.get_unit_of_measurement().empty()) { \ 19 ESP_LOGCONFIG(TAG, "%s Unit of Measurement: '%s'", prefix, (obj)->traits.get_unit_of_measurement().c_str()); \ 53 virtual void control(
float value) = 0;
uint32_t hash_base() override
bool has_state() const
Return whether this number has gotten a full state yet.
void add_on_state_callback(std::function< void(float)> &&callback)
void publish_state(float state)
CallbackManager< void(float)> state_callback_
virtual void control(float value)=0
Set the value of the number, this is a virtual method that each number integration must implement...
Base-class for all numbers.