ESPHome 2026.5.1
Loading...
Searching...
No Matches
automation.h
Go to the documentation of this file.
1#pragma once
2
5
6#include "max7219digit.h"
7
9
10template<typename... Ts> class DisplayInvertAction : public Action<Ts...>, public Parented<MAX7219Component> {
11 public:
13
14 void play(const Ts &...x) override {
15 bool state = this->state_.value(x...);
16 this->parent_->invert_on_off(state);
17 }
18};
19
20template<typename... Ts> class DisplayVisibilityAction : public Action<Ts...>, public Parented<MAX7219Component> {
21 public:
23
24 void play(const Ts &...x) override {
25 bool state = this->state_.value(x...);
26 this->parent_->turn_on_off(state);
27 }
28};
29
30template<typename... Ts> class DisplayReverseAction : public Action<Ts...>, public Parented<MAX7219Component> {
31 public:
33
34 void play(const Ts &...x) override {
35 bool state = this->state_.value(x...);
36 this->parent_->set_reverse(state);
37 }
38};
39
40template<typename... Ts> class DisplayIntensityAction : public Action<Ts...>, public Parented<MAX7219Component> {
41 public:
43
44 void play(const Ts &...x) override {
45 uint8_t state = this->state_.value(x...);
46 this->parent_->set_intensity(state);
47 }
48};
49
50} // namespace esphome::max7219digit
virtual void play(const Ts &...x)=0
Helper class to easily give an object a parent of type T.
Definition helpers.h:1861
TEMPLATABLE_VALUE(uint8_t, state) void play(const Ts &...x) override
Definition automation.h:42
TEMPLATABLE_VALUE(bool, state) void play(const Ts &...x) override
Definition automation.h:12
TEMPLATABLE_VALUE(bool, state) void play(const Ts &...x) override
Definition automation.h:32
TEMPLATABLE_VALUE(bool, state) void play(const Ts &...x) override
Definition automation.h:22
bool state
Definition fan.h:2
uint16_t x
Definition tt21100.cpp:5