homelab-codex-ws/scripts/ha/tests/fixtures/configuration.yaml
oskar 1ce8383f2e fix(ha): normalize.py round-trips custom HA !tag nodes
yaml.safe_load has no constructor for HA's `!include`/`!secret`/etc. tags
and raised ConstructorError on any real configuration.yaml. Add a
multi_constructor on `!` that generically wraps scalar/sequence/mapping
payloads in a TaggedValue, and a matching representer that re-emits the
same tag + payload — normalization stays idempotent across passes and key
sorting is unaffected by tagged values.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-07-21 17:41:12 +02:00

30 lines
630 B
YAML

homeassistant:
name: Home
time_zone: Europe/Warsaw
http:
server_port: 8123
logger:
default: info
automation: !include automations.yaml
scene: !include scenes.yaml
group: !include_dir_merge_named groups/
mqtt:
broker: 192.168.1.10
username: !secret mqtt_username
password: !secret mqtt_password
# Synthetic cases below are not real HA tags — they exist only to exercise
# generic mapping/sequence node handling for custom `!tag`s (normalize.py
# must not hardcode a list of known tag names).
zone_test: !fake_mapping_tag
latitude: 52.1
longitude: 21.0
platform_test: !fake_sequence_tag
- alpha
- beta