ESPHome 2026.5.0b1
Loading...
Searching...
No Matches
automation.h
Go to the documentation of this file.
1#pragma once
2
4
5#ifdef USE_ESP32
6
8#include "sendspin_hub.h"
9
11
12#ifdef USE_SENDSPIN_CONTROLLER
13template<typename... Ts> class SendspinSwitchCommandAction : public Action<Ts...>, public Parented<SendspinHub> {
14 public:
15 void play(const Ts &...x) override {
16 // Clear any EXTERNAL_SOURCE state so the switch command is followed
17 this->parent_->update_state(sendspin::SendspinClientState::SYNCHRONIZED);
18 this->parent_->send_client_command(sendspin::SendspinControllerCommand::SWITCH);
19 }
20};
21#endif // USE_SENDSPIN_CONTROLLER
22
23} // namespace esphome::sendspin_
24
25#endif // USE_ESP32
Helper class to easily give an object a parent of type T.
Definition helpers.h:1861
uint16_t x
Definition tt21100.cpp:5