From 0184d8e954f1d3c1346cbf4a52101c70714d623c Mon Sep 17 00:00:00 2001 From: Nikolay Vasilchuk Date: Thu, 9 Jan 2025 12:24:04 +0300 Subject: [PATCH] Deprecate StarLine engine switch attributes (#133958) Co-authored-by: Joost Lekkerkerker --- homeassistant/components/starline/account.py | 1 + homeassistant/components/starline/binary_sensor.py | 9 +++++++-- homeassistant/components/starline/icons.json | 7 +++++-- homeassistant/components/starline/strings.json | 7 +++++-- homeassistant/components/starline/switch.py | 1 + 5 files changed, 19 insertions(+), 6 deletions(-) diff --git a/homeassistant/components/starline/account.py b/homeassistant/components/starline/account.py index 4b1425ae7d9..0fb5a367148 100644 --- a/homeassistant/components/starline/account.py +++ b/homeassistant/components/starline/account.py @@ -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.""" diff --git a/homeassistant/components/starline/binary_sensor.py b/homeassistant/components/starline/binary_sensor.py index 69f0ae06d02..ac1ad4f2b6e 100644 --- a/homeassistant/components/starline/binary_sensor.py +++ b/homeassistant/components/starline/binary_sensor.py @@ -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", diff --git a/homeassistant/components/starline/icons.json b/homeassistant/components/starline/icons.json index d7d20ae03bd..07713a0cdfe 100644 --- a/homeassistant/components/starline/icons.json +++ b/homeassistant/components/starline/icons.json @@ -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": { diff --git a/homeassistant/components/starline/strings.json b/homeassistant/components/starline/strings.json index f292a74621c..b3ce755778e 100644 --- a/homeassistant/components/starline/strings.json +++ b/homeassistant/components/starline/strings.json @@ -64,8 +64,11 @@ "moving_ban": { "name": "Moving ban" }, - "is_running": { - "name": "Running" + "ignition": { + "name": "Ignition" + }, + "autostart": { + "name": "Autostart" } }, "device_tracker": { diff --git a/homeassistant/components/starline/switch.py b/homeassistant/components/starline/switch.py index 05193d98c8a..eb71f0b73b5 100644 --- a/homeassistant/components/starline/switch.py +++ b/homeassistant/components/starline/switch.py @@ -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