From f53bdd6cb95aca48e336f4e8862b69dbb6bd9885 Mon Sep 17 00:00:00 2001 From: Jan-Philipp Benecke Date: Wed, 17 Jan 2024 13:38:49 +0100 Subject: [PATCH] Add blog post about deprecating the invalid use of sensor UoMs and state classes (#2033) * Add blog post about deprecating the invalid use of sensor UoMs and state classes * Spelling * Apply review suggestions * Rename file * Rename file * Rename file and adjust name --- ...precate-invalid-sensor-uom-state-class-use.md | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 blog/2024-01-17-deprecate-invalid-sensor-uom-state-class-use.md diff --git a/blog/2024-01-17-deprecate-invalid-sensor-uom-state-class-use.md b/blog/2024-01-17-deprecate-invalid-sensor-uom-state-class-use.md new file mode 100644 index 00000000..2cd0f93c --- /dev/null +++ b/blog/2024-01-17-deprecate-invalid-sensor-uom-state-class-use.md @@ -0,0 +1,16 @@ +--- +author: Jan-Philipp Benecke +authorURL: https://github.com/jpbede +authorImageURL: https://avatars.githubusercontent.com/u/3989428?s=96&v=4 +title: "Deprecate invalid use of sensor unit of measurement and state class" +--- + +Since Home Assistant Core 2022.12, a warning is issued in the logs if a sensor entity that has a device class +uses unit of measurement and state class incorrectly, taking their device class into account. + +An invalid use would be a sensor entity that has a device class of `SensorDeviceClass.TEMPERATURE` but uses +the unit of measurement `%` instead of `°C` or `°F`; or the state class `SensorStateClass.TOTAL` +instead of `SensorStateClass.MEASUREMENT`. + +There will be a six-month deprecation period to ensure all custom integration authors have time to adjust. +As of Home Assistant Core 2024.8, the warning will then be replaced by an exception. \ No newline at end of file