已弃用的常量会产生日志条目
近年来,许多常量通过添加指向其替代项的代码注释,被 Enum 或其他值所取代。 现在使用已弃用的常量将生成一条警告日志条目,其中包含使用的集成、替代项以及该常量将从 core 中移除的版本。 将有一年的弃用期,以确保所有自定义集成作者有时间进行调整。
大多数常量应该已经被替换了,因为过去我们发布了多篇关于其弃用的博客文章。部分列于下方:
- Deprecating all SUPPORT_* constants
- Constant deprecations for 2022.5
- AutomationActionType deprecation for 2022.9
- Device tracker deprecations for 2022.9
- Deprecating media player constants
- Add new precipitation intensity units
- Introducing new unit enumerators
- Add more unit enumerators
- Add more unit enumerators
更多详情可在 core PR #105736 中找到,或者通过查看弃用 helper 中 check_if_deprecated_constant 函数的使用情况。

