ESPHome
2026.5.0b1
Loading...
Searching...
No Matches
esphome
components
sendspin
automation.h
Go to the documentation of this file.
1
#pragma once
2
3
#include "
esphome/core/defines.h
"
4
5
#ifdef USE_ESP32
6
7
#include "
esphome/core/automation.h
"
8
#include "
sendspin_hub.h
"
9
10
namespace
esphome::sendspin_
{
11
12
#ifdef USE_SENDSPIN_CONTROLLER
13
template
<
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
esphome::Action
Definition
automation.h:508
esphome::Parented
Helper class to easily give an object a parent of type T.
Definition
helpers.h:1861
esphome::Parented< SendspinHub >::parent_
SendspinHub * parent_
Definition
helpers.h:1872
esphome::sendspin_::SendspinSwitchCommandAction
Definition
automation.h:13
esphome::sendspin_::SendspinSwitchCommandAction::play
void play(const Ts &...x) override
Definition
automation.h:15
automation.h
defines.h
esphome::sendspin_
Definition
automation.h:10
sendspin_hub.h
x
uint16_t x
Definition
tt21100.cpp:5
Generated by
1.12.0