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/2023-02-28-custom-tile-features.md.

自定义 tile features

在 Home Assistant Core 2022.3 版本中,我们为 tile card 添加了自定义 features。如果您是自定义 card 的开发者,现在可以为 tile card 构建自己的 feature,而无需构建整个 card。

Screenshot showing example of custom tile feature

type: tile
entity: button.push
features:
  - type: custom:button-press-tile-feature

自定义 tile features 甚至可以使用与自定义 cards 类似的语法添加到 tile card editor 中,就像任何内置 tile feature 一样。

window.customTileFeatures = window.customTileFeatures || [];
window.customTileFeatures.push({
  type: "button-press-tile-feature",
  name: "Button press",
});

更多详情请参见 custom tile features 文档。