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/2022-02-18-paper-elements.md.

Paper Elements 正在被移除

在 Home Assistant Core 2022.3 版本中,我们正在 Frontend Repository 中移除所有 paper-dropdown-menupaper-input elements。这意味着任何之前在卡片或卡片编辑器中使用这些 elements 的 custom card 将无法正确渲染,需要更新其代码库。

使用 Home Assistant Frontend 中 elements 的 Custom Cards 从未被支持。

为什么这么做?

我们正在将代码库从已弃用的 paper elements 转换为 Google 的新 Material Web Components。这是为了使我们的前端保持与最新组件和功能同步。

Custom cards 应该怎么做?

我们的建议是使用 Scoped Custom Element Registry 在你的 custom card 中打包 Material Web Components。从 Home Assistant 2022.3 版本开始,Home Assistant Frontend 加载了为此所需的polyfill

这将允许任何 custom card 利用 Lovelace Editors 中使用的相同 MWC elements。你可以在 Boilerplate Card 中看到这种用法的示例。其他 HA elements(如图标选择器 <ha-icon-picker>)不支持以同样的方式使用。

更多信息请参见这篇旧博客文章