feat(ha): trigger Home Assistant automations from the badge - #610
Open
badbread wants to merge 1 commit into
Open
feat(ha): trigger Home Assistant automations from the badge#610badbread wants to merge 1 commit into
badbread wants to merge 1 commit into
Conversation
Adds the automation domain to the HA control path (the one piece of HA control
missing from main). automation.trigger fires the automation's actions
immediately, skipping its trigger conditions.
- server: ("automation", &[spec("trigger")]) in HA_ACTION_ALLOWLIST + guard
test; the picker offers it for free (control_domains derives from the allowlist)
- clients: automation -> trigger in each action table (single tap, no confirm,
like scene/script): ha_actions.dart, HaModels.kt, HomeAssistant.swift
- docs-site HA page: automation listed in the controllable domains
Gated by the existing default-off actuators capability; no schema change.
Signed-off-by: badbread <badbread@users.noreply.github.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.
What
Adds triggering Home Assistant automations from the on-video badge —
automation.trigger. This is the one piece of HA control that wasn't already inmain.Context
HA control already shipped in v0.2.0 (the
POST /cameras/:id/ha/actionendpoint, theactuatorscapability, and value controls for light/cover/fan). The action allowlist covered light, switch, fan, siren, cover, lock, button, input_button, scene, and script, but notautomation. So an automation entity could be linked and its state shown, but the clients rendered it read-only. This closes that gap.Changes
("automation", &[spec("trigger")])added toHA_ACTION_ALLOWLIST+ its exhaustive guard test. The entity picker offers automations for free (control_domains()derives from the allowlist, so the two can't drift).automation→triggerin each action table — a single tap fires it (immediate, no confirm, like scene/script):ha_actions.dart, AndroidHaModels.kt, iOSHomeAssistant.swiftautomationamong the controllable domains.Gated by the existing default-off
actuatorscapability. No schema change.Verification (all green, on current
main)-D warnings+cargo test --workspacecompileDebugKotlin+ unit testsBUILD SUCCESSFULflutter build windows --debugxcodebuild(no signing)BUILD SUCCEEDEDNote
Supersedes #609, which I opened by mistake off a stale checkout and have closed. This is the focused, correct change on top of current
main.