ESPHome 2026.6.0-dev
Loading...
Searching...
No Matches
mcp4461_output.h
Go to the documentation of this file.
1#pragma once
2
3#include "../mcp4461.h"
7
8namespace esphome::mcp4461 {
9
10class Mcp4461Wiper : public output::FloatOutput, public Parented<Mcp4461Component> {
11 public:
12 Mcp4461Wiper(Mcp4461Component *parent, Mcp4461WiperIdx wiper) : parent_(parent), wiper_(wiper) {}
15 void set_level(float state);
18 void set_state(bool state) override;
20 void turn_on() override;
22 void turn_off() override;
25 float read_state();
28 float update_state();
30 void increase_wiper();
32 void decrease_wiper();
35 void enable_terminal(char terminal);
38 void disable_terminal(char terminal);
39
40 protected:
41 void write_state(float state) override;
44 float state_;
45};
46
47} // namespace esphome::mcp4461
Helper class to easily give an object a parent of type T.
Definition helpers.h:1861
void set_level(float state)
Set level of wiper.
void disable_terminal(char terminal)
Disable given terminal.
float update_state()
Update current output state using device wiper state.
void turn_on() override
Enables current output.
void set_state(bool state) override
Enables/Disables current output using bool parameter.
float read_state()
Read current device wiper state without updating internal output state.
void turn_off() override
Disables current output.
void decrease_wiper()
Decrease wiper by 1 tap.
Mcp4461Wiper(Mcp4461Component *parent, Mcp4461WiperIdx wiper)
void write_state(float state) override
void increase_wiper()
Increase wiper by 1 tap.
void enable_terminal(char terminal)
Enable given terminal.
Base class for all output components that can output a variable level, like PWM.
bool state
Definition fan.h:2