7 static const char *
const TAG =
"fan.hbridge";
12 ESP_LOGD(TAG,
"Setting speed: a: %.2f, b: %.2f", a_level, b_level);
21 ESP_LOGD(TAG,
"Setting speed: a: %.2f, b: %.2f, enable: %.2f", a_level, b_level, enable);
25 ESP_LOGD(TAG,
"Braking");
32 if (restore.has_value()) {
33 restore->apply(*
this);
43 LOG_FAN(
"",
"H-Bridge Fan",
this);
45 ESP_LOGCONFIG(TAG,
" Decay Mode: Slow");
47 ESP_LOGCONFIG(TAG,
" Decay Mode: Fast");
bool state
The current on/off state of the fan.
void control(const fan::FanCall &call) override
bool oscillating
The current oscillation state of the fan.
FanDirection direction
The current direction of the fan.
optional< FanDirection > get_direction() const
void set_hbridge_levels_(float a_level, float b_level)
optional< int > get_speed() const
output::FloatOutput * pin_a_
virtual void set_state(bool state)
Enable or disable this binary output.
optional< FanRestoreState > restore_state_()
void set_level(float state)
Set the level of this float output, this is called from the front-end.
int speed
The current fan speed level.
optional< bool > get_state() const
optional< bool > get_oscillating() const
output::FloatOutput * enable_
FanCall & set_state(bool binary_state)
void set_supported_preset_modes(const std::set< std::string > &preset_modes)
Set the preset modes supported by the fan.
output::FloatOutput * pin_b_
Implementation of SPI Controller mode.
std::set< std::string > preset_modes_
void dump_config() override
output::BinaryOutput * oscillating_
std::string get_preset_mode() const