Remove deprecated horn switch in starline (#123608)

This commit is contained in:
G Johansson 2024-08-11 22:38:59 +02:00 committed by GitHub
parent 4a099ab942
commit ca34bac479
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 0 additions and 25 deletions

View File

@ -114,9 +114,6 @@
"additional_channel": {
"name": "Additional channel"
},
"horn": {
"name": "Horn"
},
"service_mode": {
"name": "Service mode"
}
@ -127,12 +124,6 @@
}
}
},
"issues": {
"deprecated_horn_switch": {
"title": "The Starline Horn switch entity is being removed",
"description": "Using the Horn switch is now deprecated and will be removed in a future version of Home Assistant.\n\nPlease adjust any automations or scripts that use Horn switch entity to instead use the Horn button entity."
}
},
"services": {
"update_state": {
"name": "Update state",

View File

@ -8,7 +8,6 @@ from homeassistant.components.switch import SwitchEntity, SwitchEntityDescriptio
from homeassistant.config_entries import ConfigEntry
from homeassistant.core import HomeAssistant
from homeassistant.helpers.entity_platform import AddEntitiesCallback
from homeassistant.helpers.issue_registry import IssueSeverity, create_issue
from .account import StarlineAccount, StarlineDevice
from .const import DOMAIN
@ -27,11 +26,6 @@ SWITCH_TYPES: tuple[SwitchEntityDescription, ...] = (
key="out",
translation_key="additional_channel",
),
# Deprecated and should be removed in 2024.8
SwitchEntityDescription(
key="poke",
translation_key="horn",
),
SwitchEntityDescription(
key="valet",
translation_key="service_mode",
@ -90,16 +84,6 @@ class StarlineSwitch(StarlineEntity, SwitchEntity):
def turn_on(self, **kwargs: Any) -> None:
"""Turn the entity on."""
if self._key == "poke":
create_issue(
self.hass,
DOMAIN,
"deprecated_horn_switch",
breaks_in_ha_version="2024.8.0",
is_fixable=False,
severity=IssueSeverity.WARNING,
translation_key="deprecated_horn_switch",
)
self._account.api.set_car_state(self._device.device_id, self._key, True)
def turn_off(self, **kwargs: Any) -> None: