Skip to content

hour_effect_v2: add configurable MQTT-driven 3D printer effect#23

Open
KrX3D wants to merge 6 commits intohour_effect_v2from
codex/add-customizable-effect-settings-via-mqtt
Open

hour_effect_v2: add configurable MQTT-driven 3D printer effect#23
KrX3D wants to merge 6 commits intohour_effect_v2from
codex/add-customizable-effect-settings-via-mqtt

Conversation

@KrX3D
Copy link
Owner

@KrX3D KrX3D commented Mar 13, 2026

Motivation

  • Provide a nicer, configurable replacement for the existing hard-coded 3D printer finished blink so an MQTT JSON payload can set colors, effect, speed, intensity, palette and duration.
  • Keep backward compatibility with the current /3dPrinterFinshed + true behavior while allowing richer control from a new topic.

Description

  • Added a new helper parse3DPrinterEffectPayload(...) to parse JSON payloads and extract r/g/b/w, effect/mode, speed, intensity, palette, and durationMs/duration with clamping and optional active/trigger/state handling.
  • Subscribed to a new group topic 3dPrinterEffect in onMqttConnect and extended message handling in onMqttMessage to accept either the legacy /3dPrinterFinshed or the new /3dPrinterEffect topic.
  • Updated the 3D-printer MQTT branch to use parsed parameters (or fall back to legacy behavior), apply the requested effect via applyEffectSettings(...), and use a per-trigger activeResetDelayMs value (bounded) for reset timing.
  • Added logging for parsing and scheduling, and ensured blocking/debounce behavior is preserved when effects run.

Testing

  • Inspected and validated code locations with searches (rg) and file excerpts to ensure hooks were placed in onMqttConnect, onMqttMessage, and reset logic, and verified the new parse3DPrinterEffectPayload declaration and implementation.
  • Reviewed change summary with git diff --stat to confirm the intended modifications to usermods/hour_effect_v2/hour_effect_v2.cpp and .h.
  • Ran git diff --check which initially reported trailing-whitespace warnings that were addressed before committing, and then committed the changes successfully.
  • No full build or hardware integration test was run in this change set; runtime behavior should be validated on device with actual MQTT messages (example JSON payload provided in code/PR metadata).

Codex Task

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant