mirror of
https://github.com/Threnklyn/esphome-dev.git
synced 2026-06-05 04:18:29 +02:00
Fix fan speed restore issue on boot (#1867)
This commit is contained in:
@@ -84,5 +84,9 @@ void TuyaFan::write_state() {
|
||||
}
|
||||
}
|
||||
|
||||
// We need a higher priority than the FanState component to make sure that the traits are set
|
||||
// when that component sets itself up.
|
||||
float TuyaFan::get_setup_priority() const { return fan_->get_setup_priority() + 1.0f; }
|
||||
|
||||
} // namespace tuya
|
||||
} // namespace esphome
|
||||
|
||||
@@ -11,6 +11,7 @@ class TuyaFan : public Component {
|
||||
public:
|
||||
TuyaFan(Tuya *parent, fan::FanState *fan, int speed_count) : parent_(parent), fan_(fan), speed_count_(speed_count) {}
|
||||
void setup() override;
|
||||
float get_setup_priority() const override;
|
||||
void dump_config() override;
|
||||
void set_speed_id(uint8_t speed_id) { this->speed_id_ = speed_id; }
|
||||
void set_switch_id(uint8_t switch_id) { this->switch_id_ = switch_id; }
|
||||
|
||||
Reference in New Issue
Block a user