Home Assistant Unofficial Reference 2024.12.1
const.py
Go to the documentation of this file.
1 """Constants for the Subaru integration."""
2 
3 from subarulink.const import ALL_DOORS, DRIVERS_DOOR, TAILGATE_DOOR
4 
5 from homeassistant.const import Platform
6 
7 DOMAIN = "subaru"
8 FETCH_INTERVAL = 300
9 UPDATE_INTERVAL = 7200
10 CONF_UPDATE_ENABLED = "update_enabled"
11 
12 # entry fields
13 ENTRY_CONTROLLER = "controller"
14 ENTRY_COORDINATOR = "coordinator"
15 ENTRY_VEHICLES = "vehicles"
16 
17 # update coordinator name
18 COORDINATOR_NAME = "subaru_data"
19 
20 # info fields
21 VEHICLE_VIN = "vin"
22 VEHICLE_MODEL_NAME = "model_name"
23 VEHICLE_MODEL_YEAR = "model_year"
24 VEHICLE_NAME = "display_name"
25 VEHICLE_HAS_EV = "is_ev"
26 VEHICLE_API_GEN = "api_gen"
27 VEHICLE_HAS_REMOTE_START = "has_res"
28 VEHICLE_HAS_REMOTE_SERVICE = "has_remote"
29 VEHICLE_HAS_SAFETY_SERVICE = "has_safety"
30 VEHICLE_LAST_UPDATE = "last_update"
31 VEHICLE_STATUS = "vehicle_status"
32 
33 
34 API_GEN_1 = "g1"
35 API_GEN_2 = "g2"
36 API_GEN_3 = "g3"
37 MANUFACTURER = "Subaru"
38 
39 PLATFORMS = [
40  Platform.DEVICE_TRACKER,
41  Platform.LOCK,
42  Platform.SENSOR,
43 ]
44 
45 SERVICE_LOCK = "lock"
46 SERVICE_UNLOCK = "unlock"
47 SERVICE_UNLOCK_SPECIFIC_DOOR = "unlock_specific_door"
48 
49 ATTR_DOOR = "door"
50 
51 UNLOCK_DOOR_ALL = "all"
52 UNLOCK_DOOR_DRIVERS = "driver"
53 UNLOCK_DOOR_TAILGATE = "tailgate"
54 UNLOCK_VALID_DOORS = {
55  UNLOCK_DOOR_ALL: ALL_DOORS,
56  UNLOCK_DOOR_DRIVERS: DRIVERS_DOOR,
57  UNLOCK_DOOR_TAILGATE: TAILGATE_DOOR,
58 }
59 
60 ICONS = {
61  "Avg Fuel Consumption": "mdi:leaf",
62  "EV Range": "mdi:ev-station",
63  "Odometer": "mdi:road-variant",
64  "Range": "mdi:gas-station",
65 }