1 """Intents for the light integration."""
3 from __future__
import annotations
7 import voluptuous
as vol
14 from .
import ATTR_BRIGHTNESS_PCT, ATTR_COLOR_TEMP_KELVIN, ATTR_RGB_COLOR, DOMAIN
16 _LOGGER = logging.getLogger(__name__)
18 INTENT_SET =
"HassLightSet"
22 """Set up the light intents."""
23 intent.async_register(
25 intent.ServiceIntentHandler(
30 (
"color", ATTR_RGB_COLOR): color_util.color_name_to_rgb,
31 (
"temperature", ATTR_COLOR_TEMP_KELVIN): cv.positive_int,
32 (
"brightness", ATTR_BRIGHTNESS_PCT): vol.All(
33 vol.Coerce(int), vol.Range(0, 100)
36 description=
"Sets the brightness or color of a light",
None async_setup_intents(HomeAssistant hass)