esphome-tw7100/switch/tw7100_switch.h

26 lines
565 B
C
Raw Permalink Normal View History

2024-09-15 18:44:45 +02:00
#pragma once
#include "esphome/core/component.h"
#include "esphome/components/switch/switch.h"
namespace esphome {
namespace tw7100 {
2024-09-16 21:45:39 +02:00
class tw7100Component;
2024-09-15 18:44:45 +02:00
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