From 1bb99f3928d4b734ddb597dc7f58d4c36ece438f Mon Sep 17 00:00:00 2001 From: Robert Resch Date: Tue, 19 Dec 2023 19:22:30 +0100 Subject: [PATCH] Add constant deprecation blog post (#2018) Co-authored-by: Martin Hjelmare --- blog/2023-12-19-constant-deprecation.md | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 blog/2023-12-19-constant-deprecation.md diff --git a/blog/2023-12-19-constant-deprecation.md b/blog/2023-12-19-constant-deprecation.md new file mode 100644 index 00000000..b4279e18 --- /dev/null +++ b/blog/2023-12-19-constant-deprecation.md @@ -0,0 +1,22 @@ +--- +author: Robert Resch +authorURL: https://github.com/edenhaus +title: "Deprecated constants create a log entry" +--- + +In recent years many constants have been replaced by Enums or other values by adding a code comment pointing to the successor. +Using deprecated constants will now create a warning log entry containing the used integration, the replacement, and the version where the constant will be removed from core. +There will be a one-year deprecation period to ensure all custom integration authors have time to adjust. + +Most constants should already have been replaced, as we created several blog posts in the past about their deprecation. Some are listed below: +- [Deprecating all SUPPORT_* constants](2022-04-02-support-constants-deprecation.md) +- [Constant deprecations for 2022.5](2022-05-03-constants-deprecations.md) +- [AutomationActionType deprecation for 2022.9](2022-08-15-automation-action-type-deprecation.md) +- [Device tracker deprecations for 2022.9](2022-07-29-device-tracker_source-type-deprecation.md) +- [Deprecating media player constants](2022-09-06-media-player-repeat-mode-deprecation.md) +- [Add new precipitation intensity units](2022-10-25-new-precipitation-intensity-units.md) +- [Introducing new unit enumerators](2022-10-26-new-unit-enumerators.md) +- [Add more unit enumerators](2022-11-28-more-unit-enumerators.md) +- [Add more unit enumerators](2022-12-05-more-unit-enumerators.md) + +More details can be found in [core PR #105736](https://github.com/home-assistant/core/pull/105736) or by checking the usage of the function [`check_if_deprecated_constant`](https://github.com/home-assistant/core/blob/dev/homeassistant/helpers/deprecation.py#L240) in the deprecation helper. \ No newline at end of file