mirror of
https://github.com/home-assistant/core.git
synced 2025-07-28 15:47:12 +00:00
Remove deprecated horn switch in starline (#123608)
This commit is contained in:
parent
4a099ab942
commit
ca34bac479
@ -114,9 +114,6 @@
|
|||||||
"additional_channel": {
|
"additional_channel": {
|
||||||
"name": "Additional channel"
|
"name": "Additional channel"
|
||||||
},
|
},
|
||||||
"horn": {
|
|
||||||
"name": "Horn"
|
|
||||||
},
|
|
||||||
"service_mode": {
|
"service_mode": {
|
||||||
"name": "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": {
|
"services": {
|
||||||
"update_state": {
|
"update_state": {
|
||||||
"name": "Update state",
|
"name": "Update state",
|
||||||
|
@ -8,7 +8,6 @@ from homeassistant.components.switch import SwitchEntity, SwitchEntityDescriptio
|
|||||||
from homeassistant.config_entries import ConfigEntry
|
from homeassistant.config_entries import ConfigEntry
|
||||||
from homeassistant.core import HomeAssistant
|
from homeassistant.core import HomeAssistant
|
||||||
from homeassistant.helpers.entity_platform import AddEntitiesCallback
|
from homeassistant.helpers.entity_platform import AddEntitiesCallback
|
||||||
from homeassistant.helpers.issue_registry import IssueSeverity, create_issue
|
|
||||||
|
|
||||||
from .account import StarlineAccount, StarlineDevice
|
from .account import StarlineAccount, StarlineDevice
|
||||||
from .const import DOMAIN
|
from .const import DOMAIN
|
||||||
@ -27,11 +26,6 @@ SWITCH_TYPES: tuple[SwitchEntityDescription, ...] = (
|
|||||||
key="out",
|
key="out",
|
||||||
translation_key="additional_channel",
|
translation_key="additional_channel",
|
||||||
),
|
),
|
||||||
# Deprecated and should be removed in 2024.8
|
|
||||||
SwitchEntityDescription(
|
|
||||||
key="poke",
|
|
||||||
translation_key="horn",
|
|
||||||
),
|
|
||||||
SwitchEntityDescription(
|
SwitchEntityDescription(
|
||||||
key="valet",
|
key="valet",
|
||||||
translation_key="service_mode",
|
translation_key="service_mode",
|
||||||
@ -90,16 +84,6 @@ class StarlineSwitch(StarlineEntity, SwitchEntity):
|
|||||||
|
|
||||||
def turn_on(self, **kwargs: Any) -> None:
|
def turn_on(self, **kwargs: Any) -> None:
|
||||||
"""Turn the entity on."""
|
"""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)
|
self._account.api.set_car_state(self._device.device_id, self._key, True)
|
||||||
|
|
||||||
def turn_off(self, **kwargs: Any) -> None:
|
def turn_off(self, **kwargs: Any) -> None:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user