For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /developers/blog/2020-04-16-hassfest.md.

custom components 的 Hassfest

Hassfest 是我们在 Home Assistant 中使用的内部工具,用于确保所有 integrations 拥有有效数据。我们现在已使 Hassfest 能够验证任何 integration,包括 custom integrations。为了让你轻松开始使用它,@ludeeus 创建了一个 GitHub Action,让你不到一分钟就能开始使用。

要安装它,请按照以下步骤操作:

  1. 在 GitHub 上打开你的 custom component 仓库

  2. 点击 "Create new file"

  3. 对于文件名,粘贴 .github/workflows/hassfest.yaml

  4. 粘贴以下内容:

    name: Validate with hassfest
    
    on:
      push:
      pull_request:
      schedule:
        - cron: "0 0 * * *"
    
    jobs:
      validate:
        runs-on: "ubuntu-latest"
        steps:
          - uses: "actions/checkout@v3"
          - uses: home-assistant/actions/hassfest@master

GitHub 现在将使用 hassfest lint 所有传入的 PR 和 commits,并且每天晚上运行一次以检查最新的 requirements。

Hassfest action 将跟踪 beta release channel。这样你就可以在 integration 与较新版本的 Home Assistant 不兼容时收到通知。