mirror of
https://github.com/esphome/esphome.git
synced 2025-11-20 00:35:44 +00:00
Add support for controlling fan direction (#1051)
* Fix fan oscillation trait not being used * Add fan direction support to SpeedFan * Add fan direction to API * Add fan direction support to BinaryFan * Fix CI errors * Fix python format * Change some ordering to trigger CI * Add test for the configuration
This commit is contained in:
@@ -16,11 +16,13 @@ class BinaryFan : public Component {
|
||||
void dump_config() override;
|
||||
float get_setup_priority() const override;
|
||||
void set_oscillating(output::BinaryOutput *oscillating) { this->oscillating_ = oscillating; }
|
||||
void set_direction(output::BinaryOutput *direction) { this->direction_ = direction; }
|
||||
|
||||
protected:
|
||||
fan::FanState *fan_;
|
||||
output::BinaryOutput *output_;
|
||||
output::BinaryOutput *oscillating_{nullptr};
|
||||
output::BinaryOutput *direction_{nullptr};
|
||||
bool next_update_{true};
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user