7 static const char *
const TAG =
"tuya.number";
12 ESP_LOGV(TAG,
"MCU reported number %u is: %d", datapoint.id, datapoint.value_int);
13 this->publish_state(datapoint.value_int / multiply_by_);
15 ESP_LOGV(TAG,
"MCU reported number %u is: %u", datapoint.id, datapoint.value_enum);
16 this->publish_state(datapoint.value_enum);
18 this->type_ = datapoint.
type;
23 ESP_LOGV(TAG,
"Setting number %u: %f", this->
number_id_, value);
34 LOG_NUMBER(
"",
"Tuya Number",
this);
35 ESP_LOGCONFIG(TAG,
" Number has datapoint ID %u", this->
number_id_);
void set_enum_datapoint_value(uint8_t datapoint_id, uint8_t value)
void publish_state(float state)
void register_listener(uint8_t datapoint_id, const std::function< void(TuyaDatapoint)> &func)
void control(float value) override
void dump_config() override
void set_integer_datapoint_value(uint8_t datapoint_id, uint32_t value)
Implementation of SPI Controller mode.