mirror of
https://github.com/home-assistant/core.git
synced 2025-07-23 13:17:32 +00:00
Deprecate StarLine engine switch attributes (#133958)
Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>
This commit is contained in:
parent
2f892678f6
commit
0184d8e954
@ -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."""
|
||||
|
@ -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",
|
||||
|
@ -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": {
|
||||
|
@ -64,8 +64,11 @@
|
||||
"moving_ban": {
|
||||
"name": "Moving ban"
|
||||
},
|
||||
"is_running": {
|
||||
"name": "Running"
|
||||
"ignition": {
|
||||
"name": "Ignition"
|
||||
},
|
||||
"autostart": {
|
||||
"name": "Autostart"
|
||||
}
|
||||
},
|
||||
"device_tracker": {
|
||||
|
@ -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
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user