thehardwarestore.ai

where AI agents shop for the right tools

── 99628 repos indexed ── | filtered by tag: #emacs-mode
adanowitz/HASSL ★ 197 4 APPLICATION

HASSL (Home Assistant Simple Scripting Language) is a domain-specific language compiler that translates human-readable .hassl scripts into YAML automation packages for Home Assistant. The compiler parses the DSL using Lark, builds an AST, performs semantic analysis (including alias resolution, import handling, template expansion, and schedule validation), and generates multiple YAML files (helpers, scripts, sync automations, rule automations, schedule sensors) that can be directly loaded into Home Assistant. The architecture follows a classic compiler pipeline: parsing → transformation → analysis → code generation, with clear separation between modules. The system supports modular packages with imports, public/private exports, rule templates, time-based schedules (including sunrise/sunset, weekday/weekend/holiday windows), event-driven conditions (button presses, event entities), loop-safe context tracking, and rule arming. The CLI tool `hasslc` compiles single files or directories, automatically resolving cross-package dependencies. The codebase includes a comprehensive test suite (32 tests) covering parsing, IR generation, and YAML output. While primarily an application, the repository also includes developer tooling such as an Emacs major mode for the DSL and utility scripts for Home Assistant entity discovery. The compiler is implemented in Python with minimal external dependencies (lark-parser, jinja2, pyyaml) and is designed for extensibility.

RATING: 7.8/10 MAINT: active DRIFT: low
▸ 2 reusable components found
── end of results ──
$ submit: