#pragma once #include "esphome/core/automation.h" #include "esphome/core/helpers.h" #include "max7219digit.h" namespace esphome { namespace max7219digit { template class DisplayInvertAction : public Action, public Parented { public: TEMPLATABLE_VALUE(bool, state) void play(Ts... x) override { bool state = this->state_.value(x...); this->parent_->invert_on_off(state); } }; template class DisplayVisibilityAction : public Action, public Parented { public: TEMPLATABLE_VALUE(bool, state) void play(Ts... x) override { bool state = this->state_.value(x...); this->parent_->turn_on_off(state); } }; template class DisplayReverseAction : public Action, public Parented { public: TEMPLATABLE_VALUE(bool, state) void play(Ts... x) override { bool state = this->state_.value(x...); this->parent_->set_reverse(state); } }; template class DisplayIntensityAction : public Action, public Parented { public: TEMPLATABLE_VALUE(uint8_t, state) void play(Ts... x) override { uint8_t state = this->state_.value(x...); this->parent_->set_intensity(state); } }; } // namespace max7219digit } // namespace esphome