#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