ESPHome  2024.12.2
homeassistant_switch.h
Go to the documentation of this file.
1 #pragma once
2 
5 
6 namespace esphome {
7 namespace homeassistant {
8 
10  public:
11  void set_entity_id(const std::string &entity_id) { this->entity_id_ = entity_id; }
12  void setup() override;
13  void dump_config() override;
14  float get_setup_priority() const override;
15 
16  protected:
17  void write_state(bool state) override;
18  std::string entity_id_;
19 };
20 
21 } // namespace homeassistant
22 } // namespace esphome
Base class for all switches.
Definition: switch.h:39
void set_entity_id(const std::string &entity_id)
Implementation of SPI Controller mode.
Definition: a01nyub.cpp:7
bool state
The current reported state of the binary sensor.
Definition: switch.h:53