Repository navigation
v2.0.0 — rewire onto shared valar-core v0.3.0 + scheduling packages - #5
Merged
Merged
Conversation
Refactor the 2939-line monolith into a board wrapper + product layer that pull the shared valar-core (v0.3.0) and scheduling mixin as packages, keeping only Glasscalibur's product hardware and logic in glasscalibur-product.yaml. Board wrapper (Glasscalibur-esphome.yml): chip, GPIO map, OTA identity, and the stepper_* / motor_direction_default substitutions that express Glasscalibur's 220 mOhm / inf-decel / counter-clockwise hardware against core's defaults. Stripped (now from core/scheduling): api, ota, http_request, safe_mode, wifi, captive_portal, improv_serial, logger base, web_server base, uart, the tmc2209 driver + its on_boot config, Speed/Accel/IRUN/TCOOLTHRS/SGTHRS numbers, SG_RESULT/ TSTEP sensors, Restart/Update-Firmware buttons, Firmware Version + wifi_info, WiFi Signal/Uptime/ESP temp, and the entire sun/time schedule (time, sun, the Schedule/Sun switches, Lat/Long/offset numbers, Open/Close Time, Timezone, and the sun-poll interval). Kept (product): buzzer, i2c, LIS2DH12, TMP1075, cover, limit switches, tamper sensor, child lock, tamper/vibration switches+numbers, auto-calibration scripts, tamper/vibration/completion intervals, lifetime counters, State/Cal Status. Reconciled: on_stall replaced via !remove + re-add; num_irun !extended to cap at 19; sel_direction and phantom btn2/btn3 !removed (Glasscalibur has 2 buttons and fixed ccw direction); on_boot split into priority 650 (irun clamp, before core's currents) and 500 (restore + limit-switch homing, after core configures); global_max_speed renamed to core's global_speed; schedule_open/schedule_close scripts added for the scheduling mixin contract. Verification: esphome config valid; regression gate (entity + behaviour) shows only intended diffs — tuning entities adopt core's names, on_boot reorganized without losing an action, schedule moved to the mixin, plus the new "Board" diagnostic. OTA URL and device name preserved byte-for-byte. NOTE: board wrapper uses local includes for dev; swap to remote ref v0.3.0 once core v0.3.0 is tagged. A build-release CI workflow still needs adding. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…gelog - Board wrapper now pulls valar-core + scheduling from Valar-Systems/valar-motion at ref v0.3.0 (remote packages) instead of dev-time local includes. Config re-validated against the released tag; regression gate unchanged. - Add .github/workflows/build-release.yml (mirrors the Ropener pipeline, single board): compiles on push/PR, and on a v* tag stamps fw_version from the tag and attaches Glasscalibur.factory.bin / .ota.bin / .ota.bin.md5 to the release. The on-device GitHub-OTA button depends on that asset existing. - CHANGELOG: document v2.0.0 (valar-core rewrite, auto-calibration, breaking tuning-entity renames) and switch the version source note to the release tag. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…tion Vibration-based stall detection is an accelerometer feature, not StallGuard, so give it its own "Stall Detection" group. Demote the TMC2209 StallGuard controls to an advanced group at the very bottom (as on the Ropener), and pull the SG_RESULT/TSTEP readouts down into it. Page order is now: Control, Motion Tuning (Speed/Accel/Motor Current), Calibration (Auto-Calibrate + status), Stall Detection (vibration), Schedule, Security/Tamper, Diagnostics, StallGuard (advanced) — SGTHRS/TCOOLTHRS/SG_RESULT/ TSTEP/enable. Uses product-local groups and !extend to move core entities, leaving core's group_motion/group_stallguard/group_setup empty (they don't render). Entity set and behaviour unchanged (regression gate identical; sorting is gate-blind). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…Control - Add a "Motor Current" number in milliamps to Motion Tuning, driven by the driver's own read_run_current_mA / write_run_current_mA (no hand formula). Capped at 600 mA = IRUN 19, this motor's thermal ceiling. Keeps global_irun in sync. - Demote the raw IRUN register to "IRUN value" in the advanced StallGuard group for power users (still capped at 19). - Move the Motion Tuning group to weight 12 so it sits immediately under Control. Verified on hardware: Motor Current reads 538 mA at IRUN 17 (exact conversion). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Rearchitects the firmware from a 2939-line monolith into a board wrapper + product layer that pull the shared valar-core (v0.3.0) and scheduling packages from
Valar-Systems/valar-motion. Board infrastructure now comes from core; only Glasscalibur's product hardware and logic stay local.What moved where
schedule_open/schedule_closescripts.on_stall(via!remove+ re-add);num_iruncapped at 19;sel_directionand phantombtn2/btn3!removed (2 buttons, fixed ccw direction viamotor_direction_default); on_boot split into priority 650 (current clamp) + 500 (restore + limit homing);global_max_speed→ core'sglobal_speed.Decisions (per review)
BREAKING
Tuning entity names now match core across the Valar line (
max_speed→Speed,acceleration→Acceleration,irun→IRUN (motor current),SGTHRS→SGTHRS (stall threshold),TSTEP Sensor→TSTEP,SG_RESULT Sensor→SG_RESULT). HAentity_ids change accordingly. NewBoarddiagnostic added.Verification
esphome configvalid against the released corev0.3.0tag.global_speedrename, after which the calibration scripts/intervals are byte-identical. on_boot reorganization verified action-by-action to lose nothing.firmware.factory.bin+firmware.ota.bin.Glasscalibur.ota.bin) and device name preserved byte-for-byte.🤖 Generated with Claude Code