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

@@ -1,5 +1,6 @@
#include <catch2/catch_all.hpp>
#include <slic3r/Utils/MoonrakerPrinterAgent.hpp>
#include <slic3r/Utils/NetworkAgentFactory.hpp>
#include <slic3r/plugin/PythonPluginBridge.hpp>
@@ -12,6 +13,15 @@
using namespace Slic3r;
namespace py = pybind11;
TEST_CASE("unit: Moonraker light name matching", "[unit][moonraker]")
{
CHECK(moonraker_is_light_name("caselight"));
CHECK(moonraker_is_light_name("LED_STRIP"));
CHECK_FALSE(moonraker_is_light_name("beeper"));
CHECK(moonraker_is_light_name("FLASHLIGHT_SWITCH"));
CHECK(moonraker_is_light_name("MODLELIGHT_SWITCH"));
}
// ===========================================================================
// UNIT - printer-agent registry duplicate handling.
// Confirms a duplicate agent id is rejected so a plugin cannot shadow a built-in