ESPHome  2025.4.0
mcp4461_output.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include "../mcp4461.h"
7 
8 namespace esphome {
9 namespace mcp4461 {
10 
11 class Mcp4461Wiper : public output::FloatOutput, public Parented<Mcp4461Component> {
12  public:
13  Mcp4461Wiper(Mcp4461Component *parent, Mcp4461WiperIdx wiper) : parent_(parent), wiper_(wiper) {}
16  void set_level(float state);
19  void set_state(bool state) override;
21  void turn_on() override;
23  void turn_off() override;
26  float read_state();
29  float update_state();
31  void increase_wiper();
33  void decrease_wiper();
36  void enable_terminal(char terminal);
39  void disable_terminal(char terminal);
40 
41  protected:
42  void write_state(float state) override;
45  float state_;
46 };
47 
48 } // namespace mcp4461
49 } // namespace esphome
bool state
Definition: fan.h:34
void write_state(float state) override
void turn_off() override
Disables current output.
Base class for all output components that can output a variable level, like PWM.
Definition: float_output.h:31
Mcp4461Wiper(Mcp4461Component *parent, Mcp4461WiperIdx wiper)
void set_level(float state)
Set level of wiper.
void turn_on() override
Enables current output.
void enable_terminal(char terminal)
Enable given terminal.
float read_state()
Read current device wiper state without updating internal output state.
void increase_wiper()
Increase wiper by 1 tap.
void disable_terminal(char terminal)
Disable given terminal.
void decrease_wiper()
Decrease wiper by 1 tap.
Implementation of SPI Controller mode.
Definition: a01nyub.cpp:7
void set_state(bool state) override
Enables/Disables current output using bool parameter.
Helper class to easily give an object a parent of type T.
Definition: helpers.h:538
float update_state()
Update current output state using device wiper state.