Remove battery properties from vacuum entity (#2695)

Co-authored-by: Franck Nijhof <git@frenck.dev>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
G Johansson 2025-07-02 19:37:02 +02:00 committed by GitHub
parent 77d0ea69c8
commit 805d4e37aa
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 16 additions and 3 deletions

View File

@ -0,0 +1,16 @@
---
author: G Johansson
authorURL: https://github.com/gjohansson-ST
authorImageURL: https://avatars.githubusercontent.com/u/62932417?v=4
authorTwitter: GJohansson
title: "Vacuum battery properties are deprecated"
---
As of Home Assistant Core 2025.8, the two properties for battery in `StateVacuumEntity`, `battery_level` and `battery_icon`, have been deprecated.
The `battery_level` and `battery_icon` properties should be replaced by a separate sensor with the `battery` sensor device class and optionally a customized icon if the default icon of the battery sensor device class isn't wanted.
Optionally consider to also provide a binary sensor with the `charging` device class if it's currently charging or not.
There is a one-year deprecation period, and the two battery properties will stop working from 2026.8 to ensure all custom integration authors have time to adjust.
More details can be found in the [architectural decision](https://github.com/home-assistant/architecture/discussions/938).

View File

@ -13,8 +13,6 @@ Properties should always only return information from memory and not do I/O (lik
| Name | Type | Default | Description
| ---- | ---- | ------- | -----------
| battery_icon | string | function | Battery icon to show in UI.
| battery_level | int | `none` | Current battery level.
| fan_speed | string | `none` | The current fan speed.
| fan_speed_list | list | `NotImplementedError()`| List of available fan speeds.
| name | string | **Required** | Name of the entity.
@ -42,7 +40,6 @@ must set the `VacuumEntityFeature.STATE` flag.
| Value | Description |
| -------------- | ---------------------------------------------------- |
| `BATTERY` | The vacuum supports retrieving battery status. |
| `CLEAN_SPOT` | The vacuum supports spot cleaning. |
| `FAN_SPEED` | The vacuum supports setting fan speed. |
| `LOCATE` | The vacuum supports locating. |