Skip to content

v0.8.18 - Template Compiler for Dependency Detection

Choose a tag to compare

@jonducrou jonducrou released this 08 Oct 10:18
· 6 commits to main since this release

Template Compiler for Dependency Detection

This release improves template dependency detection by using Home Assistant's built-in template compiler instead of regex parsing.

Key Changes

🔧 Template Compiler Integration

  • Now uses Template.async_render_to_info() - the same method Developer Tools uses
  • Applies to all template types: helpers, automations, scripts, and conditions
  • More reliable for complex templates with multi-line syntax and nested structures

✨ Improved Coverage

  • Template select entities (addresses #15)
  • Template sensors, binary sensors, switches, buttons, numbers, text
  • Automation/script template conditions
  • Template shorthand conditions

🛡️ Reliability

  • Handles all Jinja2 template syntax correctly
  • Stays in sync with Home Assistant's template engine
  • Graceful fallback to regex parsing if compilation fails

Benefits

This change makes template dependency detection significantly more reliable, especially for complex templates like the one shown in issue #15. The integration now uses the exact same method that Home Assistant's Developer Tools uses to show "Entities in template".

Installation

Install via HACS or manually:

  1. Copy custom_components/ha_visualiser to your HA config directory
  2. Restart Home Assistant
  3. The integration will automatically update

🤖 Generated with Claude Code