Home Assistant Unofficial Reference 2024.12.1
const.py
Go to the documentation of this file.
1 """Allows to configure custom shell commands to turn a value for a sensor."""
2 
3 import logging
4 
5 from homeassistant.components.sensor import CONF_STATE_CLASS
6 from homeassistant.const import (
7  CONF_DEVICE_CLASS,
8  CONF_ICON,
9  CONF_UNIQUE_ID,
10  CONF_UNIT_OF_MEASUREMENT,
11  Platform,
12 )
14  CONF_AVAILABILITY,
15  CONF_PICTURE,
16 )
17 
18 LOGGER = logging.getLogger(__package__)
19 
20 CONF_COMMAND_TIMEOUT = "command_timeout"
21 CONF_JSON_ATTRIBUTES = "json_attributes"
22 CONF_JSON_ATTRIBUTES_PATH = "json_attributes_path"
23 DEFAULT_TIMEOUT = 15
24 DOMAIN = "command_line"
25 PLATFORMS = [
26  Platform.BINARY_SENSOR,
27  Platform.COVER,
28  Platform.SENSOR,
29  Platform.SWITCH,
30 ]
31 
32 TRIGGER_ENTITY_OPTIONS = {
33  CONF_AVAILABILITY,
34  CONF_DEVICE_CLASS,
35  CONF_ICON,
36  CONF_PICTURE,
37  CONF_STATE_CLASS,
38  CONF_UNIQUE_ID,
39  CONF_UNIT_OF_MEASUREMENT,
40 }