Skip to content

Fix the 4 dead *_changed flow triggers#12

Merged
Bre77 merged 1 commit into
mainfrom
fm/homey-flow-triggers-r1
Jul 22, 2026
Merged

Fix the 4 dead *_changed flow triggers#12
Bre77 merged 1 commit into
mainfrom
fm/homey-flow-triggers-r1

Conversation

@Bre77

@Bre77 Bre77 commented Jul 22, 2026

Copy link
Copy Markdown
Member

Intent

  • Fix the 4 app-level *_changed flow triggers so they actually fire: allow_export_changed, backup_reserve_changed, operation_mode_changed, steering_wheel_heater_changed
    • Root cause: these cards are declared in .homeycompose/flow/triggers/ but nothing ever calls .trigger() on them. TeslemetryDevice.update() only calls setCapabilityValue, so a flow built on any of these cards silently never runs
    • Fix: update() now fires the matching device trigger card with the new value as its token whenever one of these four capabilities actually changes (old value != new value), so unrelated polling/SSE updates that leave the value unchanged don't spam the flow
  • Add regression tests (test/capability-change-triggers.test.ts) proving a changed value fires the matching card with the right token, an unchanged value doesn't fire it, and capabilities with no declared trigger card never fire one

allow_export_changed, backup_reserve_changed, operation_mode_changed,
and steering_wheel_heater_changed were declared as flow trigger cards
but nothing ever called them, so flows built on them silently never ran.

update() now fires the matching device trigger card with the new value
whenever one of these capabilities actually changes.
@Bre77
Bre77 merged commit 7054106 into main Jul 22, 2026
2 checks passed
Bre77 added a commit that referenced this pull request Jul 22, 2026
…, remove dead onoff.defrost config (#14)

The four dead *_changed flow triggers (allow_export, backup_reserve,
operation_mode, steering_wheel_heater) were already fixed in #12, but
the regression test only exercised backup_reserve and
steering_wheel_heater directly. Add explicit fire/no-fire tests for
allow_export_changed and operation_mode_changed so all four declared
triggers are covered individually.

Also remove the orphaned onoff.defrost capabilitiesOptions block in
the vehicle driver compose - the capability was never added to the
driver's capabilities array, so this config was dead.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant