2 Commits

Author SHA1 Message Date
ec2062872c Fix v2: Handle included files and list-item template format
Critical fixes for real-world HA configurations:
- Scans ALL .yaml files in /config/ and /config/packages/
- Handles "- platform: template" (list item with dash)
- Properly extracts sensors from "sensors:" blocks
- Handles multiline templates with > operator
- Correct indentation for modern template: format
- Counts sensors correctly from included files

This version will find all 67+ legacy template entities in typical HA setups.
2025-12-23 12:53:00 +11:00
5171723a05 Add pure bash template migration script (no Python dependencies)
Safe and reliable bash-only implementation:
- Works in SSH add-on without Python
- Uses awk for YAML parsing (reliable and fast)
- Automatic timestamped backups
- Extracts legacy template definitions
- Converts to modern template: syntax
- Removes legacy platform: template blocks
- Adds modern templates to configuration.yaml
- Generates restore script for rollback
- Exit on error for safety (set -e)
- Temp directory cleanup with trap

Fixes all 67 template deprecation warnings without Python dependencies.
2025-12-23 12:30:19 +11:00