ESPHome 2026.3.0-dev
Loading...
Searching...
No Matches
automation.h
Go to the documentation of this file.
1#pragma once
4#include "safe_mode.h"
5
7
8#ifdef USE_SAFE_MODE_CALLBACK
9class SafeModeTrigger final : public Trigger<> {
10 public:
12 parent->add_on_safe_mode_callback([this]() { trigger(); });
13 }
14};
15#endif // USE_SAFE_MODE_CALLBACK
16
17template<typename... Ts> class MarkSuccessfulAction : public Action<Ts...>, public Parented<SafeModeComponent> {
18 public:
19 void play(const Ts &...x) override { this->parent_->mark_successful(); }
20};
21
22} // namespace esphome::safe_mode
Helper class to easily give an object a parent of type T.
Definition helpers.h:1618
void trigger(const Ts &...x)
Definition automation.h:325
void play(const Ts &...x) override
Definition automation.h:19
SafeModeComponent provides a safe way to recover from repeated boot failures.
Definition safe_mode.h:18
void add_on_safe_mode_callback(std::function< void()> &&callback)
Definition safe_mode.h:37
SafeModeTrigger(SafeModeComponent *parent)
Definition automation.h:11
uint16_t x
Definition tt21100.cpp:5