From 47a6359f6c4c421ac0ca108a7515a262fb9a6eb4 Mon Sep 17 00:00:00 2001 From: JonatanRek Date: Tue, 31 Dec 2024 08:22:30 +0100 Subject: [PATCH] Fixes --- automation.cpp | 18 ++++++++++++++++++ automation.h | 8 ++++++++ 2 files changed, 26 insertions(+) create mode 100644 automation.cpp create mode 100644 automation.h diff --git a/automation.cpp b/automation.cpp new file mode 100644 index 0000000..a2afc3d --- /dev/null +++ b/automation.cpp @@ -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 class SetTemperatureAction : public Action { + public: + explicit SetTemperatureAction(Marlin2 *a_marlin2) : switch_(a_marlin2) {} + + void play(Ts... x) override { this->switch_->turn_on(); } + + protected: + Switch *switch_; +}; +} // namespace esphome \ No newline at end of file diff --git a/automation.h b/automation.h new file mode 100644 index 0000000..f95c0b0 --- /dev/null +++ b/automation.h @@ -0,0 +1,8 @@ +#include "automation.h" +#include "esphome/core/log.h" + +namespace esphome { + +static const char *const TAG = "switch.automation"; + +} // namespace esphome \ No newline at end of file