From 7ee65d6f63cd0aedc574f8433b0747c5aed8b1fd Mon Sep 17 00:00:00 2001 From: G Johansson Date: Tue, 24 Sep 2024 18:27:31 +0000 Subject: [PATCH] Change light state to enum --- blog/2024-09-24-state-constant-light-deprecation.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 blog/2024-09-24-state-constant-light-deprecation.md diff --git a/blog/2024-09-24-state-constant-light-deprecation.md b/blog/2024-09-24-state-constant-light-deprecation.md new file mode 100644 index 00000000..4e48582b --- /dev/null +++ b/blog/2024-09-24-state-constant-light-deprecation.md @@ -0,0 +1,13 @@ +--- +author: G Johansson +authorURL: https://github.com/gjohansson-ST +authorImageURL: https://avatars.githubusercontent.com/u/62932417?v=4 +authorTwitter: GJohansson +title: "Deprecating state constant for light" +--- + +As of Home Assistant Core 2024.10, the constant `STATE_ON` used to return state in `LightEntity` are deprecated when imported from `homeassistant.components.light`. It has been replaced by the `LightState` enum. + +There is a one-year deprecation period, and the constants will stop working from 2025.10 to ensure all custom integration authors have time to adjust. + +As the `state` property is not meant to be overwritten, in most cases this change will only affect other Entity properties, methods or tests rather than the `state` property.