ESPHomeMarlin2/automation.h

24 lines
536 B
C
Raw Normal View History

2025-03-03 09:46:15 +01:00
#pragma once
2025-03-03 10:05:58 +01:00
#include "marlin2.h"
2025-03-03 09:46:15 +01:00
#include "esphome/core/automation.h"
#include <vector>
2024-12-31 08:22:30 +01:00
namespace esphome {
2025-03-05 17:42:01 +01:00
template<typename... Ts> class Marlin2WriteGCodeAction : public Action<Ts...> {
2025-03-03 09:46:15 +01:00
public:
2025-03-05 17:42:01 +01:00
explicit Marlin2WriteGCodeAction(Marlin2 *marlin2) : marlin2_(marlin2) {}
TEMPLATABLE_VALUE(std::string, gcode)
2025-03-03 09:46:15 +01:00
void play(Ts... x) override {
2025-03-05 17:42:01 +01:00
this->marlin2_->write_str("\r\n\r\nM117 Action Called!\r\n");;
2025-03-03 09:46:15 +01:00
}
2025-03-05 17:42:01 +01:00
2025-03-03 09:46:15 +01:00
protected:
2025-03-05 17:42:01 +01:00
Marlin2 *marlin2_;
2025-03-03 09:46:15 +01:00
};
2024-12-31 08:22:30 +01:00
} // namespace esphome