mirror of
https://github.com/esphome/esphome.git
synced 2025-04-09 04:10:35 +01:00
* Cleanup dashboard JS * Add vscode * Save start_mark/end_mark * Updates * Updates * Remove need for cv.nameable It's a bit hacky but removes so much bloat from integrations * Add enum helper * Document APIs, and Improvements * Fixes * Fixes * Update PULL_REQUEST_TEMPLATE.md * Updates * Updates * Updates
29 lines
772 B
C++
29 lines
772 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; }
|
|
|
|
protected:
|
|
fan::FanState *fan_;
|
|
output::BinaryOutput *output_;
|
|
output::BinaryOutput *oscillating_{nullptr};
|
|
bool next_update_{true};
|
|
};
|
|
|
|
} // namespace binary
|
|
} // namespace esphome
|