7 static const char *
const TAG =
"tuya.fan";
12 ESP_LOGV(TAG,
"MCU reported speed of: %d", datapoint.
value_enum);
13 if (datapoint.
value_enum >= this->speed_count_) {
14 ESP_LOGE(TAG,
"Speed has invalid value %d", datapoint.
value_enum);
23 ESP_LOGV(TAG,
"MCU reported switch is: %s", ONOFF(datapoint.
value_bool));
30 ESP_LOGV(TAG,
"MCU reported oscillation is: %s", ONOFF(datapoint.
value_bool));
37 ESP_LOGD(TAG,
"MCU reported reverse direction is: %s", ONOFF(datapoint.
value_bool));
46 restored->to_call(*this).perform();
51 LOG_FAN(
"",
"Tuya Fan",
this);
53 ESP_LOGCONFIG(TAG,
" Speed has datapoint ID %u", *this->
speed_id_);
56 ESP_LOGCONFIG(TAG,
" Switch has datapoint ID %u", *this->
switch_id_);
59 ESP_LOGCONFIG(TAG,
" Oscillation has datapoint ID %u", *this->
oscillation_id_);
62 ESP_LOGCONFIG(TAG,
" Direction has datapoint ID %u", *this->
direction_id_);
bool state
The current on/off state of the fan.
bool oscillating
The current oscillation state of the fan.
fan::FanTraits get_traits() override
void set_enum_datapoint_value(uint8_t datapoint_id, uint8_t value)
FanDirection direction
The current direction of the fan.
optional< FanDirection > get_direction() const
optional< int > get_speed() const
optional< FanRestoreState > restore_state_()
void register_listener(uint8_t datapoint_id, const std::function< void(TuyaDatapoint)> &func)
void add_on_initialized_callback(std::function< void()> callback)
optional< uint8_t > switch_id_
int speed
The current fan speed level.
optional< bool > get_state() const
optional< bool > get_oscillating() const
void control(const fan::FanCall &call) override
optional< uint8_t > oscillation_id_
void set_boolean_datapoint_value(uint8_t datapoint_id, bool value)
void dump_config() override
optional< uint8_t > direction_id_
optional< uint8_t > speed_id_