2022.4 中的开发者新功能
2022.4 中有一些面向开发者的新功能:
- Integration Type:集成现在可以标记自己为 helper。
- Backup platform:集成现在可以通过实现新的 backup platform 在备份期间暂停工作。
- entity registry 中的 hidden_by:实体现在可以通过 entity registry 隐藏。当向 voice assistants 等外部 UI 暴露实体时,这些实体应默认为不包含。
- [新的和更新的 selectors]:我们添加了一堆新的 selectors,可用于 blueprints、services.yaml 和 config flows。
- [backend flows 中的 selectors]:现在可以在 config flows 中使用
selectorhelper。它的配置和渲染方式与 services.yaml/blueprints 中的 selectors 完全相同。 - ha-form context:Context 是一种允许 selectors 根据其他字段的值进行动态配置的新方式。目前仅适用于 attribute selector。
- [config flow fields 的 helper text]:Config flow fields 现在可以有一个 description。
- Schema Config Flow helper:基于 config schema 创建 config flows 的新 helper。示例实现
- Show Menu step:数据录入流程中的这个新步骤会向用户显示一个菜单。
- Fan speed:我们引入了一个新格式,此过渡现已完成。
- Device State Attributes:此属性的向后兼容支持在自 Home Assistant 2021.4 弃用后已被移除。请改用
extra_state_attributes。 - [不带 width/height 的 Cameras]:已移除不带 width/height 的 cameras 的兼容层。
- Calendar offset:
calculate_offset和is_offset_reached的 Calendar 方法签名已更改,为 Calendar 的 typing 改进做准备,并可能进一步简化 offsets。

