github 3dg1luk43/ha_creality_ws v0.5.1

latest releases: v0.6.5, v0.6.5-alpha, v0.6.4...
one month ago

ha_creality_ws v0.5.1

This combined release fixes the Lovelace card not showing in the picker (and the visual editor error), adds automatic cache-busting for the card resource, hardens the WebSocket client, and introduces unit tests and shared utilities.

Breaking change

  • Card element tag renamed to comply with Custom Elements spec:
    • Old: custom:k_printer_card
    • New: custom:k-printer-card
    • Update any YAML cards to use the new tag.

Highlights

  • Card picker/visual editor
    • Card appears again in the picker.
    • Visual editor works (editor element is properly defined).
  • Resource auto-registration (storage mode)
    • Lovelace resource now registered/updated with cache-busting query (?v=), so updates load without manual cache clears.
  • WebSocket client
    • URL built from WS_URL_TEMPLATE (no hardcoded port).
    • Clearer connect/close/error logging with host context.
    • Keeps app-level heartbeat and periodic GETs for steady telemetry.
  • Reliability
    • Lovelace resource registration failures are non-fatal and won’t block setup.

Code quality

  • New utils module:
    • coerce_numbers, parse_model_version, parse_position, safe_float, extract_host_from_zeroconf.
  • Sensors/entities refactored to use helpers; duplicate imports and placeholders removed.
  • Unit tests for utils (pure unit tests; no HA runtime required).
  • Minimal CI workflow to run pytest on pushes/PRs.
  • README updated with new tag and storage-mode cache-busting.

Dependency

  • Added to integration requirements: websockets>=10.4

Upgrade notes

  1. Update your card YAML (if needed)
    • type: custom:k-printer-card
  2. Hard refresh Lovelace once
    • Desktop: Ctrl+F5 (Windows/Linux), ⌘+Shift+R (macOS)
    • Mobile App: App Settings → Reload resources (or force close)
  3. Storage mode resource
    • Settings → Dashboards → ⋮ → Resources should list:
      • /local/ha_creality_ws/k_printer_card.js?v=<build_mtime> (type: module)
    • If duplicates exist, keep the versioned entry and remove the old one.
  4. YAML mode resource
    • Keep: /local/ha_creality_ws/k_printer_card.js
    • Optionally add ?v=1 once to bust cache.

Troubleshooting

  • If the card still appears stale:
    • Verify the resource is versioned in storage mode or add a one-time ?v= in YAML mode.
    • Check browser console for 404s or custom element definition errors and open an issue with logs.

Thanks for using ha_creality_ws!

Don't miss a new ha_creality_ws release

NewReleases is sending notifications on new releases.