mirror of
https://github.com/Threnklyn/esphome-dev.git
synced 2026-05-31 10:08:27 +02:00
Make some Action methods protected
Apparently play()/stop() etc. are not meant to be called directly by users of the class and if they're called directly that would not give the expected result for the classes that have an empty play(). Make all methods except play_complex, stop_comples and is_running protected. While there also make RemoteTransmitterActionBase::encode protected.
This commit is contained in:
committed by
Andrew Zaborowski
parent
da390d32f8
commit
a62b6548d2
@@ -391,7 +391,9 @@ class Image {
|
||||
template<typename... Ts> class DisplayPageShowAction : public Action<Ts...> {
|
||||
public:
|
||||
TEMPLATABLE_VALUE(DisplayPage *, page)
|
||||
void play(Ts... x) override {
|
||||
|
||||
protected:
|
||||
void play_(Ts... x) override {
|
||||
auto *page = this->page_.value(x...);
|
||||
if (page != nullptr) {
|
||||
page->show();
|
||||
@@ -402,18 +404,20 @@ template<typename... Ts> class DisplayPageShowAction : public Action<Ts...> {
|
||||
template<typename... Ts> class DisplayPageShowNextAction : public Action<Ts...> {
|
||||
public:
|
||||
DisplayPageShowNextAction(DisplayBuffer *buffer) : buffer_(buffer) {}
|
||||
void play(Ts... x) override { this->buffer_->show_next_page(); }
|
||||
|
||||
protected:
|
||||
void play_(Ts... x) override { this->buffer_->show_next_page(); }
|
||||
|
||||
DisplayBuffer *buffer_;
|
||||
};
|
||||
|
||||
template<typename... Ts> class DisplayPageShowPrevAction : public Action<Ts...> {
|
||||
public:
|
||||
DisplayPageShowPrevAction(DisplayBuffer *buffer) : buffer_(buffer) {}
|
||||
void play(Ts... x) override { this->buffer_->show_prev_page(); }
|
||||
|
||||
protected:
|
||||
void play_(Ts... x) override { this->buffer_->show_prev_page(); }
|
||||
|
||||
DisplayBuffer *buffer_;
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user