mirror of
https://github.com/esphome/esphome.git
synced 2025-01-05 20:31:44 +01:00
0bb81e5b2d
* 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
30 lines
905 B
C++
30 lines
905 B
C++
#pragma once
|
|
|
|
#include "esphome/core/component.h"
|
|
#include "esphome/components/output/binary_output.h"
|
|
#include "esphome/components/fan/fan_state.h"
|
|
|
|
namespace esphome {
|
|
namespace binary {
|
|
|
|
class BinaryFan : public Component {
|
|
public:
|
|
void set_fan(fan::FanState *fan) { fan_ = fan; }
|
|
void set_output(output::BinaryOutput *output) { output_ = output; }
|
|
void setup() override;
|
|
void loop() override;
|
|
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};
|
|
};
|
|
|
|
} // namespace binary
|
|
} // namespace esphome
|