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 10 of 21, split alphabetically by component (matrix_keypad .. micronova).
19 lines
421 B
C++
19 lines
421 B
C++
|
|
#pragma once
|
|
#include "esphome/core/automation.h"
|
|
#include "max17043.h"
|
|
|
|
namespace esphome::max17043 {
|
|
|
|
template<typename... Ts> class SleepAction final : public Action<Ts...> {
|
|
public:
|
|
explicit SleepAction(MAX17043Component *max17043) : max17043_(max17043) {}
|
|
|
|
void play(const Ts &...x) override { this->max17043_->sleep_mode(); }
|
|
|
|
protected:
|
|
MAX17043Component *max17043_;
|
|
};
|
|
|
|
} // namespace esphome::max17043
|