1
0
mirror of https://github.com/esphome/esphome.git synced 2025-09-10 23:32:23 +01:00

Fix fan speed restore issue on boot (#1867)

This commit is contained in:
wifwucite
2021-09-08 05:30:17 +02:00
committed by GitHub
parent b0533db2eb
commit 1be106c0b5
5 changed files with 14 additions and 3 deletions

View File

@@ -55,7 +55,10 @@ void BinaryFan::loop() {
ESP_LOGD(TAG, "Setting reverse direction: %s", ONOFF(enable));
}
}
float BinaryFan::get_setup_priority() const { return setup_priority::DATA; }
// We need a higher priority than the FanState component to make sure that the traits are set
// when that component sets itself up.
float BinaryFan::get_setup_priority() const { return fan_->get_setup_priority() + 1.0f; }
} // namespace binary
} // namespace esphome