AgentSkillsCN

ha-test-harness

Home Assistant 自定义组件的测试模式——协调器和实体单元测试、注册表覆盖、写路径测试和 unique_id/设备稳定性检查。

SKILL.md
--- frontmatter
name: ha-test-harness
description: Testing patterns for Home Assistant custom components—coordinator and entity unit tests, register map coverage, write-path tests, and unique_id/device stability checks.
license: Complete terms in LICENSE.txt

HA Test Harness

Use when adding tests for a custom integration.

Quick start

  • Unit test the coordinator (success, cached fallback, error paths, option changes).
  • Validate register maps and expected entities (keys, tiers, categories).
  • Test entity properties (state_class/device_class/units) and translation_key wiring.
  • Write-path tests: encoding, device_id usage, no immediate refresh contention.

References