Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions homeassistant/components/tuya/strings.json
Original file line number Diff line number Diff line change
Expand Up @@ -212,5 +212,15 @@
}
}
}
},
"issues": {
"service_deprecation_turn_off": {
"title": "Tuya vacuum support for vacuum.turn_off is being removed",
"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",
"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."
}
}
}
21 changes: 21 additions & 0 deletions homeassistant/components/tuya/vacuum.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
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

Expand Down Expand Up @@ -153,10 +154,30 @@ def state(self) -> str | None:
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."""
Expand Down