Deprecate StarLine engine switch attributes (#133958)

Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>
This commit is contained in:
Nikolay Vasilchuk 2025-01-09 12:24:04 +03:00 committed by GitHub
parent 2f892678f6
commit 0184d8e954
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 19 additions and 6 deletions

View File

@ -180,6 +180,7 @@ class StarlineAccount:
"online": device.online,
}
# Deprecated and should be removed in 2025.8
@staticmethod
def engine_attrs(device: StarlineDevice) -> dict[str, Any]:
"""Attributes for engine switch."""

View File

@ -43,8 +43,13 @@ BINARY_SENSOR_TYPES: tuple[BinarySensorEntityDescription, ...] = (
),
BinarySensorEntityDescription(
key="run",
translation_key="is_running",
device_class=BinarySensorDeviceClass.RUNNING,
translation_key="ignition",
entity_registry_enabled_default=False,
),
BinarySensorEntityDescription(
key="r_start",
translation_key="autostart",
entity_registry_enabled_default=False,
),
BinarySensorEntityDescription(
key="hfree",

View File

@ -13,8 +13,11 @@
"moving_ban": {
"default": "mdi:car-off"
},
"is_running": {
"default": "mdi:speedometer"
"ignition": {
"default": "mdi:key-variant"
},
"autostart": {
"default": "mdi:auto-mode"
}
},
"button": {

View File

@ -64,8 +64,11 @@
"moving_ban": {
"name": "Moving ban"
},
"is_running": {
"name": "Running"
"ignition": {
"name": "Ignition"
},
"autostart": {
"name": "Autostart"
}
},
"device_tracker": {

View File

@ -72,6 +72,7 @@ class StarlineSwitch(StarlineEntity, SwitchEntity):
def extra_state_attributes(self):
"""Return the state attributes of the switch."""
if self._key == "ign":
# Deprecated and should be removed in 2025.8
return self._account.engine_attrs(self._device)
return None