Remove deprecated vacuum services from tuya (#107896)

This commit is contained in:
Jan-Philipp Benecke 2024-01-16 08:51:57 +01:00 committed by GitHub
parent 562798f037
commit af6ad6be41
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 0 additions and 58 deletions

View file

@ -817,29 +817,5 @@
"name": "Sterilization"
}
}
},
"issues": {
"service_deprecation_turn_off": {
"title": "Tuya vacuum support for vacuum.turn_off is being removed",
"fix_flow": {
"step": {
"confirm": {
"title": "[%key:component::tuya::issues::service_deprecation_turn_off::title%]",
"description": "Tuya vacuum support for the vacuum.turn_off service is deprecated and will be removed in Home Assistant 2024.2; Please adjust any automation or script that uses the service to instead call vacuum.stop and select submit below to mark this issue as resolved."
}
}
}
},
"service_deprecation_turn_on": {
"title": "Tuya vacuum support for vacuum.turn_on is being removed",
"fix_flow": {
"step": {
"confirm": {
"title": "[%key:component::tuya::issues::service_deprecation_turn_on::title%]",
"description": "Tuya vacuum support for the vacuum.turn_on service is deprecated and will be removed in Home Assistant 2024.2; Please adjust any automation or script that uses the service to instead call vacuum.start and select submit below to mark this issue as resolved."
}
}
}
}
}
}

View file

@ -15,7 +15,6 @@ from homeassistant.components.vacuum import (
from homeassistant.config_entries import ConfigEntry
from homeassistant.const import STATE_IDLE, STATE_PAUSED
from homeassistant.core import HomeAssistant, callback
from homeassistant.helpers import issue_registry as ir
from homeassistant.helpers.dispatcher import async_dispatcher_connect
from homeassistant.helpers.entity_platform import AddEntitiesCallback
@ -105,11 +104,6 @@ class TuyaVacuumEntity(TuyaEntity, StateVacuumEntity):
if self.find_dpcode(DPCode.SEEK, prefer_function=True):
self._attr_supported_features |= VacuumEntityFeature.LOCATE
if self.find_dpcode(DPCode.POWER, prefer_function=True):
self._attr_supported_features |= (
VacuumEntityFeature.TURN_ON | VacuumEntityFeature.TURN_OFF
)
if self.find_dpcode(DPCode.POWER_GO, prefer_function=True):
self._attr_supported_features |= (
VacuumEntityFeature.STOP | VacuumEntityFeature.START
@ -151,34 +145,6 @@ class TuyaVacuumEntity(TuyaEntity, StateVacuumEntity):
return None
return TUYA_STATUS_TO_HA.get(status)
def turn_on(self, **kwargs: Any) -> None:
"""Turn the device on."""
self._send_command([{"code": DPCode.POWER, "value": True}])
ir.async_create_issue(
self.hass,
DOMAIN,
"service_deprecation_turn_on",
breaks_in_ha_version="2024.2.0",
is_fixable=True,
is_persistent=True,
severity=ir.IssueSeverity.WARNING,
translation_key="service_deprecation_turn_on",
)
def turn_off(self, **kwargs: Any) -> None:
"""Turn the device off."""
self._send_command([{"code": DPCode.POWER, "value": False}])
ir.async_create_issue(
self.hass,
DOMAIN,
"service_deprecation_turn_off",
breaks_in_ha_version="2024.2.0",
is_fixable=True,
is_persistent=True,
severity=ir.IssueSeverity.WARNING,
translation_key="service_deprecation_turn_off",
)
def start(self, **kwargs: Any) -> None:
"""Start the device."""
self._send_command([{"code": DPCode.POWER_GO, "value": True}])