fix: make Klipper macro lamp control reliable

This commit is contained in:
Andrew
2026-07-27 17:38:32 +08:00
committed by Ian Chua
parent cd6d2cbf5e
commit 76f9de4cfb
3 changed files with 64 additions and 18 deletions

View File

@@ -14,6 +14,8 @@
namespace Slic3r {
bool moonraker_is_light_name(const std::string& name);
class MoonrakerPrinterAgent : public IPrinterAgent
{
public:
@@ -201,6 +203,7 @@ private:
std::atomic<int> next_jsonrpc_id{1};
std::set<std::string> available_objects; // Track for feature detection
bool assumed_light_on = false;
std::atomic<bool> ws_stop{false};
std::atomic<bool> ws_reconnect_requested{false}; // Flag to trigger reconnection