ESPHome 2026.11.0-dev
Loading...
Searching...
No Matches
pipsolar_output.h
Go to the documentation of this file.
1#pragma once
2
3#include "../pipsolar.h"
6
7#include <vector>
8
9namespace esphome::pipsolar {
10
11class Pipsolar;
12
13class PipsolarOutput final : public output::FloatOutput {
14 public:
16 void set_parent(Pipsolar *parent) { this->parent_ = parent; }
17 void set_set_command(const char *command) { this->set_command_ = command; }
19 void set_set_command(const std::string &command) = delete;
20 void set_possible_values(std::vector<float> possible_values) { this->possible_values_ = std::move(possible_values); }
21 void set_value(float value) { this->write_state(value); }
22
23 protected:
24 void write_state(float state) override;
25 const char *set_command_{nullptr};
27 std::vector<float> possible_values_;
28};
29
30} // namespace esphome::pipsolar
Base class for all output components that can output a variable level, like PWM.
void set_parent(Pipsolar *parent)
void set_set_command(const char *command)
void set_possible_values(std::vector< float > possible_values)
void write_state(float state) override
void set_set_command(const std::string &command)=delete
Prevent accidental use of std::string which would dangle.
std::vector< float > possible_values_
bool state
Definition fan.h:2