This commit is contained in:
Václav Španinger 2024-12-31 08:22:30 +01:00
parent 97450423d3
commit 47a6359f6c
2 changed files with 26 additions and 0 deletions

18
automation.cpp Normal file
View File

@ -0,0 +1,18 @@
#pragma once
#include "esphome/core/component.h"
#include "esphome/core/automation.h"
#include "esphome/components/switch/switch.h"
namespace esphome {
template<typename... Ts> class SetTemperatureAction : public Action<Ts...> {
public:
explicit SetTemperatureAction(Marlin2 *a_marlin2) : switch_(a_marlin2) {}
void play(Ts... x) override { this->switch_->turn_on(); }
protected:
Switch *switch_;
};
} // namespace esphome

8
automation.h Normal file
View File

@ -0,0 +1,8 @@
#include "automation.h"
#include "esphome/core/log.h"
namespace esphome {
static const char *const TAG = "switch.automation";
} // namespace esphome