mirror of
https://github.com/Threnklyn/esphome-dev.git
synced 2026-06-02 02:58:26 +02:00
Refactor fan platform to resemble climate/cover platforms (#2848)
Co-authored-by: Oxan van Leeuwen <oxan@oxanvanleeuwen.nl> Co-authored-by: rob-deutsch <robzyb+altgithub@gmail.com> Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
This commit is contained in:
@@ -30,6 +30,14 @@ class BinaryOutput {
|
||||
void set_power_supply(power_supply::PowerSupply *power_supply) { this->power_.set_parent(power_supply); }
|
||||
#endif
|
||||
|
||||
/// Enable or disable this binary output.
|
||||
virtual void set_state(bool state) {
|
||||
if (state)
|
||||
this->turn_on();
|
||||
else
|
||||
this->turn_off();
|
||||
}
|
||||
|
||||
/// Enable this binary output.
|
||||
virtual void turn_on() {
|
||||
#ifdef USE_POWER_SUPPLY
|
||||
|
||||
Reference in New Issue
Block a user