esphome-tw7100/switch/tw7100_switch.h

25 lines
564 B
C
Raw Normal View History

2024-09-15 18:44:45 +02:00
#pragma once
#include "esphome/core/component.h"
#include "esphome/components/switch/switch.h"
#include "../tw7100.h"
namespace esphome {
namespace tw7100 {
class tw7100Switch : public switch_::Switch, public Component {
public:
void dump_config() override;
void set_tw7100_parent(tw7100Component *parent) { this->parent_ = parent; }
void set_cmd(std::string cmd) { this->cmd_ = cmd; }
protected:
void write_state(bool state) override;
std::string cmd_;
tw7100Component *parent_;
};
} // namespace tw7100
} // namespace esphome