2019-03-07 03:44:52 +00:00
|
|
|
"""Constants for the homekit_controller component."""
|
2021-01-26 19:45:01 +00:00
|
|
|
from aiohomekit.model.characteristics import CharacteristicsTypes
|
|
|
|
|
2019-07-31 19:25:30 +00:00
|
|
|
DOMAIN = "homekit_controller"
|
2019-03-07 03:44:52 +00:00
|
|
|
|
2019-09-03 15:27:14 +00:00
|
|
|
KNOWN_DEVICES = f"{DOMAIN}-devices"
|
|
|
|
CONTROLLER = f"{DOMAIN}-controller"
|
|
|
|
ENTITY_MAP = f"{DOMAIN}-entity-map"
|
2020-09-11 18:34:07 +00:00
|
|
|
TRIGGERS = f"{DOMAIN}-triggers"
|
2019-03-07 03:44:52 +00:00
|
|
|
|
2019-07-31 19:25:30 +00:00
|
|
|
HOMEKIT_DIR = ".homekit"
|
|
|
|
PAIRING_FILE = "pairing.json"
|
2019-03-28 03:01:10 +00:00
|
|
|
|
2019-03-07 03:44:52 +00:00
|
|
|
# Mapping from Homekit type to component.
|
|
|
|
HOMEKIT_ACCESSORY_DISPATCH = {
|
2019-07-31 19:25:30 +00:00
|
|
|
"lightbulb": "light",
|
|
|
|
"outlet": "switch",
|
|
|
|
"switch": "switch",
|
|
|
|
"thermostat": "climate",
|
2020-08-25 16:56:01 +00:00
|
|
|
"heater-cooler": "climate",
|
2019-07-31 19:25:30 +00:00
|
|
|
"security-system": "alarm_control_panel",
|
|
|
|
"garage-door-opener": "cover",
|
|
|
|
"window": "cover",
|
|
|
|
"window-covering": "cover",
|
|
|
|
"lock-mechanism": "lock",
|
|
|
|
"contact": "binary_sensor",
|
|
|
|
"motion": "binary_sensor",
|
2019-08-01 10:24:46 +00:00
|
|
|
"carbon-dioxide": "sensor",
|
2019-07-31 19:25:30 +00:00
|
|
|
"humidity": "sensor",
|
2020-11-14 17:59:13 +00:00
|
|
|
"humidifier-dehumidifier": "humidifier",
|
2019-07-31 19:25:30 +00:00
|
|
|
"light": "sensor",
|
|
|
|
"temperature": "sensor",
|
2019-08-31 12:18:18 +00:00
|
|
|
"battery": "sensor",
|
2019-12-30 08:05:49 +00:00
|
|
|
"smoke": "binary_sensor",
|
2020-09-10 11:25:14 +00:00
|
|
|
"carbon-monoxide": "binary_sensor",
|
2020-03-24 20:49:01 +00:00
|
|
|
"leak": "binary_sensor",
|
2020-01-05 14:56:46 +00:00
|
|
|
"fan": "fan",
|
|
|
|
"fanv2": "fan",
|
2020-01-06 15:35:10 +00:00
|
|
|
"air-quality": "air_quality",
|
2020-02-25 22:01:03 +00:00
|
|
|
"occupancy": "binary_sensor",
|
2020-03-05 13:49:56 +00:00
|
|
|
"television": "media_player",
|
2020-03-18 21:20:40 +00:00
|
|
|
"valve": "switch",
|
2020-11-14 12:07:22 +00:00
|
|
|
"camera-rtp-stream-management": "camera",
|
2019-03-07 03:44:52 +00:00
|
|
|
}
|
2021-01-26 19:45:01 +00:00
|
|
|
|
|
|
|
CHARACTERISTIC_PLATFORMS = {
|
2021-06-28 21:48:29 +00:00
|
|
|
CharacteristicsTypes.Vendor.EVE_ENERGY_WATT: "sensor",
|
2021-08-03 12:30:50 +00:00
|
|
|
CharacteristicsTypes.Vendor.EVE_DEGREE_AIR_PRESSURE: "sensor",
|
|
|
|
CharacteristicsTypes.Vendor.EVE_DEGREE_ELEVATION: "number",
|
2021-01-26 19:45:01 +00:00
|
|
|
CharacteristicsTypes.Vendor.KOOGEEK_REALTIME_ENERGY: "sensor",
|
2021-07-23 17:37:18 +00:00
|
|
|
CharacteristicsTypes.Vendor.KOOGEEK_REALTIME_ENERGY_2: "sensor",
|
2021-07-26 15:46:36 +00:00
|
|
|
CharacteristicsTypes.Vendor.VOCOLINC_HUMIDIFIER_SPRAY_LEVEL: "number",
|
2021-08-23 18:47:09 +00:00
|
|
|
CharacteristicsTypes.TEMPERATURE_CURRENT: "sensor",
|
|
|
|
CharacteristicsTypes.RELATIVE_HUMIDITY_CURRENT: "sensor",
|
|
|
|
CharacteristicsTypes.AIR_QUALITY: "sensor",
|
|
|
|
CharacteristicsTypes.DENSITY_PM25: "sensor",
|
|
|
|
CharacteristicsTypes.DENSITY_PM10: "sensor",
|
|
|
|
CharacteristicsTypes.DENSITY_OZONE: "sensor",
|
|
|
|
CharacteristicsTypes.DENSITY_NO2: "sensor",
|
|
|
|
CharacteristicsTypes.DENSITY_SO2: "sensor",
|
|
|
|
CharacteristicsTypes.DENSITY_VOC: "sensor",
|
2021-01-26 19:45:01 +00:00
|
|
|
}
|
2021-08-23 18:47:09 +00:00
|
|
|
|
|
|
|
# For legacy reasons, "built-in" characteristic types are in their short form
|
|
|
|
# And vendor types don't have a short form
|
|
|
|
# This means long and short forms get mixed up in this dict, and comparisons
|
|
|
|
# don't work!
|
|
|
|
# We call get_uuid on *every* type to normalise them to the long form
|
|
|
|
# Eventually aiohomekit will use the long form exclusively amd this can be removed.
|
|
|
|
for k, v in list(CHARACTERISTIC_PLATFORMS.items()):
|
|
|
|
value = CHARACTERISTIC_PLATFORMS.pop(k)
|
|
|
|
CHARACTERISTIC_PLATFORMS[CharacteristicsTypes.get_uuid(k)] = value
|