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