Home Assistant Unofficial Reference 2024.12.1
const.py
Go to the documentation of this file.
1 """Constants for the Hue component."""
2 
3 from aiohue.v2.models.button import ButtonEvent
4 from aiohue.v2.models.relative_rotary import (
5  RelativeRotaryAction,
6  RelativeRotaryDirection,
7 )
8 
9 DOMAIN = "hue"
10 
11 CONF_IGNORE_AVAILABILITY = "ignore_availability"
12 
13 CONF_SUBTYPE = "subtype"
14 
15 ATTR_HUE_EVENT = "hue_event"
16 SERVICE_HUE_ACTIVATE_SCENE = "hue_activate_scene"
17 ATTR_GROUP_NAME = "group_name"
18 ATTR_SCENE_NAME = "scene_name"
19 ATTR_TRANSITION = "transition"
20 ATTR_DYNAMIC = "dynamic"
21 
22 
23 # V1 API SPECIFIC CONSTANTS ##################
24 
25 GROUP_TYPE_LIGHT_GROUP = "LightGroup"
26 GROUP_TYPE_ROOM = "Room"
27 GROUP_TYPE_LUMINAIRE = "Luminaire"
28 GROUP_TYPE_LIGHT_SOURCE = "LightSource"
29 GROUP_TYPE_ZONE = "Zone"
30 GROUP_TYPE_ENTERTAINMENT = "Entertainment"
31 
32 CONF_ALLOW_HUE_GROUPS = "allow_hue_groups"
33 DEFAULT_ALLOW_HUE_GROUPS = False
34 
35 CONF_ALLOW_UNREACHABLE = "allow_unreachable"
36 DEFAULT_ALLOW_UNREACHABLE = False
37 
38 # How long to wait to actually do the refresh after requesting it.
39 # We wait some time so if we control multiple lights, we batch requests.
40 REQUEST_REFRESH_DELAY = 0.3
41 
42 
43 # V2 API SPECIFIC CONSTANTS ##################
44 
45 DEFAULT_BUTTON_EVENT_TYPES = (
46  # I have never ever seen the `DOUBLE_SHORT_RELEASE` event so leave it out here
47  ButtonEvent.INITIAL_PRESS,
48  ButtonEvent.REPEAT,
49  ButtonEvent.SHORT_RELEASE,
50  ButtonEvent.LONG_PRESS,
51  ButtonEvent.LONG_RELEASE,
52 )
53 
54 DEFAULT_ROTARY_EVENT_TYPES = (RelativeRotaryAction.START, RelativeRotaryAction.REPEAT)
55 DEFAULT_ROTARY_EVENT_SUBTYPES = (
56  RelativeRotaryDirection.CLOCK_WISE,
57  RelativeRotaryDirection.COUNTER_CLOCK_WISE,
58 )
59 
60 DEVICE_SPECIFIC_EVENT_TYPES = {
61  # device specific overrides of specific supported button events
62  "Hue tap switch": (ButtonEvent.INITIAL_PRESS,),
63 }