2019-12-01 22:12:57 +00:00
|
|
|
"""Intents for the cover integration."""
|
|
|
|
from homeassistant.core import HomeAssistant
|
|
|
|
from homeassistant.helpers import intent
|
|
|
|
|
2019-12-08 16:58:00 +00:00
|
|
|
from . import DOMAIN, SERVICE_CLOSE_COVER, SERVICE_OPEN_COVER
|
2019-12-01 22:12:57 +00:00
|
|
|
|
|
|
|
INTENT_OPEN_COVER = "HassOpenCover"
|
|
|
|
INTENT_CLOSE_COVER = "HassCloseCover"
|
|
|
|
|
|
|
|
|
|
|
|
async def async_setup_intents(hass: HomeAssistant) -> None:
|
|
|
|
"""Set up the cover intents."""
|
|
|
|
hass.helpers.intent.async_register(
|
|
|
|
intent.ServiceIntentHandler(
|
|
|
|
INTENT_OPEN_COVER, DOMAIN, SERVICE_OPEN_COVER, "Opened {}"
|
|
|
|
)
|
|
|
|
)
|
|
|
|
hass.helpers.intent.async_register(
|
|
|
|
intent.ServiceIntentHandler(
|
|
|
|
INTENT_CLOSE_COVER, DOMAIN, SERVICE_CLOSE_COVER, "Closed {}"
|
|
|
|
)
|
|
|
|
)
|