Files
ruvnet--RuView/v2/crates/homecore-automation/Cargo.toml
T
ruv 347aad9bfa feat(homecore-automation/p1): ADR-129 automation engine + MiniJinja templates (34 tests pass)
Scaffolds `v2/crates/homecore-automation` per ADR-129 HOMECORE-AUTO:
- Automation struct with RunMode (single/restart/queued/parallel/ignore_first)
- Trigger enum: State, NumericState, Time, Event + EvaluateTrigger trait
- Condition enum: State, NumericState, Template, And, Or, Not + async evaluate
- Action enum: ServiceCall, Delay, Scene, WaitForTrigger, Choose + async execute
- TemplateEnvironment: MiniJinja 2.x with HA globals states(), state_attr(), is_state(), now()
- AutomationEngine: subscribes to state-machine broadcast, evaluates triggers, runs action tasks

34 unit tests pass (0 failed). MiniJinja filter coverage: states, state_attr, is_state, now (P1 set).
Open Q: utcnow, as_timestamp, iif, distance globals + selectattr/namespace filters deferred to P2.

Co-Authored-By: claude-flow <ruv@ruv.net>
2026-05-25 18:28:41 -04:00

49 lines
1.6 KiB
TOML

# homecore-automation — HOMECORE automation engine, trigger evaluator, and
# MiniJinja template evaluator.
# Implements ADR-129 (HOMECORE-AUTO): YAML automation parser, trigger/condition/
# action evaluation, AutomationEngine runtime that subscribes to the HOMECORE
# event bus and fires automations.
[package]
name = "homecore-automation"
version = "0.1.0-alpha.0"
edition = "2021"
license = "MIT"
authors = ["rUv <ruv@ruv.net>", "HOMECORE Contributors"]
description = "Automation engine, trigger evaluator, and MiniJinja template evaluator for HOMECORE (ADR-129)"
repository = "https://github.com/ruvnet/RuView"
[lib]
name = "homecore_automation"
path = "src/lib.rs"
[dependencies]
# HOMECORE core — state machine, event bus, service registry, entity types
homecore = { path = "../homecore" }
# Async runtime
tokio = { version = "1", features = ["sync", "rt", "rt-multi-thread", "time", "macros"] }
# Serialization — YAML automation files + JSON service call data
serde = { version = "1", features = ["derive"] }
serde_yaml = "0.9"
serde_json = "1"
# MiniJinja — HA-compatible Jinja2 template engine in pure Rust (ADR-129 §2.1)
minijinja = { version = "2", features = ["json", "loader"] }
# Error handling
thiserror = "1"
# Time — chrono DateTime for triggers + condition evaluation
chrono = { version = "0.4", features = ["serde"] }
# Async trait for EvaluateTrigger + condition evaluate
async-trait = "0.1"
# Unique IDs for automation instances
uuid = { version = "1", features = ["v4"] }
[dev-dependencies]
tokio = { version = "1", features = ["sync", "rt", "rt-multi-thread", "time", "macros", "test-util"] }