Files
esphome-dev/esphome/components/pipsolar/switch/pipsolar_switch.h
T
Andreas Hergert d3375193a9 Feature pipsolar anh (#1664)
Co-authored-by: Andreas Hergert <andreas.hergert@otrs.com>
Co-authored-by: Otto Winter <otto@otto-winter.com>
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
2021-08-11 07:48:32 +12:00

26 lines
711 B
C++

#pragma once
#include "../pipsolar.h"
#include "esphome/components/switch/switch.h"
#include "esphome/core/component.h"
namespace esphome {
namespace pipsolar {
class Pipsolar;
class PipsolarSwitch : public switch_::Switch, public Component {
public:
void set_parent(Pipsolar *parent) { this->parent_ = parent; };
void set_on_command(std::string command) { this->on_command_ = std::move(command); };
void set_off_command(std::string command) { this->off_command_ = std::move(command); };
void dump_config() override;
protected:
void write_state(bool state) override;
std::string on_command_;
std::string off_command_;
Pipsolar *parent_;
};
} // namespace pipsolar
} // namespace esphome