Skip to content

Add HomeyScript dashboard widgets and batch execution metadata - #64

Draft
jeroenwienk wants to merge 4 commits into
masterfrom
feature/widgets
Draft

jeroenwienk wants to merge 4 commits into
masterfrom
feature/widgets

Conversation

@jeroenwienk

Copy link
Copy Markdown
Contributor

Add dashboard controls for running saved HomeyScripts and displaying their latest results. The widget picker provides Script Button and Script Result, each with a standard and transparent variant. Requires Homey 12.3.0 or later.

  • Script Button uses a compact play control with an editable label or optional argument input. Click and Enter share submission handling, with IME protection, duplicate-run prevention, optional clearing after success, and optional result output. Existing output stays visible during execution, and busy feedback finishes its 0.4-second animation cycle.
  • Script Result updates through realtime events after widget, editor, and saved-script Flow runs, with polling and visibility recovery for missed events. Both widgets support custom titles, optional status text, automatic height, and light/dark themes. Includes picker previews, API routes, and script autocomplete for all four variants.
  • Move execution timestamps out of script definitions and batch changed metadata every 10 minutes, with a best-effort flush on unload. Existing timestamps migrate automatically and API responses retain lastExecuted; script edits still save immediately. Downgrading to the old storage format is not supported.

Widget result values remain in memory and reset on app restart. The SDK still sends the whole app-settings document for each save, so batching reduces write frequency rather than the size of each underlying write. Transparency is static; runtime transparency remains separate work.

Validation: all 37 tests pass, ESLint and scoped Prettier checks pass, generated manifests and standard/transparent asset parity are verified, and Homey publish validation passes. Browser checks covered submission, sizing, themes, and animation behavior. Installed successfully on a development Homey and verified migration preserves existing script definitions and timestamps. Unload flushing is covered with a mocked Homey SDK; actual shutdown persistence has not yet been confirmed.

Add versioned content blocks, Markdown, named-script actions and forms with typed events, field validation errors and retain/clear/reset behavior. Share the document contract, interaction controller and renderer across all four widgets, and add a playground using Homey OS styles with examples, public types and regression coverage.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant