7static const char *
const TAG =
"tuya.number";
16 ESP_LOGV(TAG,
"MCU reported number %u is: %d", datapoint.
id, datapoint.
value_int);
22 ESP_LOGV(TAG,
"MCU reported number %u is: %u", datapoint.
id, datapoint.
value_enum);
28 ESP_LOGW(TAG,
"Reported type (%d) is not a number!",
static_cast<int>(datapoint.
type));
33 ESP_LOGW(TAG,
"Reported type (%d) different than previously set (%d)!",
static_cast<int>(datapoint.
type),
34 static_cast<int>(*this->type_));
54 ESP_LOGW(TAG,
"Failed to restore and there is no initial value defined. Setting min_value (%f)", value);
65 ESP_LOGV(TAG,
"Setting number %u: %f", this->
number_id_, value);
79 LOG_NUMBER(
"",
"Tuya Number",
this);
80 ESP_LOGCONFIG(TAG,
" Number has datapoint ID %u", this->
number_id_);
82 ESP_LOGCONFIG(TAG,
" Datapoint type is %d",
static_cast<int>(*this->
type_));
84 ESP_LOGCONFIG(TAG,
" Datapoint type is unknown");
91 ESP_LOGCONFIG(TAG,
" Restore Value: %s", YESNO(this->
restore_value_));
virtual ESPPreferenceObject make_preference(size_t length, uint32_t type, bool in_flash)=0
uint32_t get_object_id_hash()
void publish_state(float state)
float get_min_value() const
void add_on_initialized_callback(std::function< void()> callback)
void set_enum_datapoint_value(uint8_t datapoint_id, uint8_t value)
void register_listener(uint8_t datapoint_id, const std::function< void(TuyaDatapoint)> &func)
void set_integer_datapoint_value(uint8_t datapoint_id, uint32_t value)
optional< TuyaDatapointType > type_
optional< float > initial_value_
void control(float value) override
ESPPreferenceObject pref_
void dump_config() override
Providing packet encoding functions for exchanging data with a remote host.
ESPPreferences * global_preferences