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