ESPHome 2026.3.0-dev
Loading...
Searching...
No Matches
pipsolar_switch.h
Go to the documentation of this file.
1#pragma once
2
3#include "../pipsolar.h"
6
7namespace esphome {
8namespace pipsolar {
9class Pipsolar;
11 public:
12 void set_parent(Pipsolar *parent) { this->parent_ = parent; }
13 void set_on_command(const char *command) { this->on_command_ = command; }
14 void set_off_command(const char *command) { this->off_command_ = command; }
16 void set_on_command(const std::string &command) = delete;
17 void set_off_command(const std::string &command) = delete;
18 void dump_config() override;
19
20 protected:
21 void write_state(bool state) override;
22 const char *on_command_{nullptr};
23 const char *off_command_{nullptr};
25};
26
27} // namespace pipsolar
28} // namespace esphome
void set_parent(Pipsolar *parent)
void set_off_command(const char *command)
void set_on_command(const std::string &command)=delete
Prevent accidental use of std::string which would dangle.
void set_off_command(const std::string &command)=delete
void write_state(bool state) override
void set_on_command(const char *command)
Base class for all switches.
Definition switch.h:38
bool state
The current reported state of the binary sensor.
Definition switch.h:55
Providing packet encoding functions for exchanging data with a remote host.
Definition a01nyub.cpp:7