mirror of https://github.com/home-assistant/core
34 lines
913 B
Python
34 lines
913 B
Python
"""Intents for the vacuum integration."""
|
|
|
|
from homeassistant.core import HomeAssistant
|
|
from homeassistant.helpers import intent
|
|
|
|
from . import DOMAIN, SERVICE_RETURN_TO_BASE, SERVICE_START
|
|
|
|
INTENT_VACUUM_START = "HassVacuumStart"
|
|
INTENT_VACUUM_RETURN_TO_BASE = "HassVacuumReturnToBase"
|
|
|
|
|
|
async def async_setup_intents(hass: HomeAssistant) -> None:
|
|
"""Set up the vacuum intents."""
|
|
intent.async_register(
|
|
hass,
|
|
intent.ServiceIntentHandler(
|
|
INTENT_VACUUM_START,
|
|
DOMAIN,
|
|
SERVICE_START,
|
|
description="Starts a vacuum",
|
|
platforms={DOMAIN},
|
|
),
|
|
)
|
|
intent.async_register(
|
|
hass,
|
|
intent.ServiceIntentHandler(
|
|
INTENT_VACUUM_RETURN_TO_BASE,
|
|
DOMAIN,
|
|
SERVICE_RETURN_TO_BASE,
|
|
description="Returns a vacuum to base",
|
|
platforms={DOMAIN},
|
|
),
|
|
)
|