mirror of
https://github.com/esphome/esphome.git
synced 2026-06-24 13:27:14 +00:00
Add the C++ `final` specifier to leaf, user-configurable component classes and automation action/trigger/condition primitives so that classes meant to be terminal cannot be subclassed by external components. Only classes never used as a base anywhere in the tree are marked. Part 8 of 21, split alphabetically by component (hm3301 .. integration).
21 lines
530 B
C++
21 lines
530 B
C++
#pragma once
|
|
|
|
#include "esphome/components/switch/switch.h"
|
|
#include "esphome/core/component.h"
|
|
|
|
namespace esphome::homeassistant {
|
|
|
|
class HomeassistantSwitch final : public switch_::Switch, public Component {
|
|
public:
|
|
void set_entity_id(const char *entity_id) { this->entity_id_ = entity_id; }
|
|
void setup() override;
|
|
void dump_config() override;
|
|
float get_setup_priority() const override;
|
|
|
|
protected:
|
|
void write_state(bool state) override;
|
|
const char *entity_id_{nullptr};
|
|
};
|
|
|
|
} // namespace esphome::homeassistant
|