Home Assistant Unofficial Reference 2024.12.1
const.py
Go to the documentation of this file.
1 """iCloud component constants."""
2 
3 from homeassistant.const import Platform
4 
5 DOMAIN = "icloud"
6 
7 CONF_WITH_FAMILY = "with_family"
8 CONF_MAX_INTERVAL = "max_interval"
9 CONF_GPS_ACCURACY_THRESHOLD = "gps_accuracy_threshold"
10 
11 DEFAULT_WITH_FAMILY = False
12 DEFAULT_MAX_INTERVAL = 30 # min
13 DEFAULT_GPS_ACCURACY_THRESHOLD = 500 # meters
14 
15 # to store the cookie
16 STORAGE_KEY = DOMAIN
17 STORAGE_VERSION = 2
18 
19 PLATFORMS = [Platform.DEVICE_TRACKER, Platform.SENSOR]
20 
21 # pyicloud.AppleDevice status
22 DEVICE_BATTERY_LEVEL = "batteryLevel"
23 DEVICE_BATTERY_STATUS = "batteryStatus"
24 DEVICE_CLASS = "deviceClass"
25 DEVICE_DISPLAY_NAME = "deviceDisplayName"
26 DEVICE_ID = "id"
27 DEVICE_LOCATION = "location"
28 DEVICE_LOCATION_HORIZONTAL_ACCURACY = "horizontalAccuracy"
29 DEVICE_LOCATION_LATITUDE = "latitude"
30 DEVICE_LOCATION_LONGITUDE = "longitude"
31 DEVICE_LOST_MODE_CAPABLE = "lostModeCapable"
32 DEVICE_LOW_POWER_MODE = "lowPowerMode"
33 DEVICE_NAME = "name"
34 DEVICE_PERSON_ID = "prsId"
35 DEVICE_RAW_DEVICE_MODEL = "rawDeviceModel"
36 DEVICE_STATUS = "deviceStatus"
37 
38 DEVICE_STATUS_SET = [
39  "features",
40  "maxMsgChar",
41  "darkWake",
42  "fmlyShare",
43  DEVICE_STATUS,
44  "remoteLock",
45  "activationLocked",
46  DEVICE_CLASS,
47  DEVICE_ID,
48  "deviceModel",
49  DEVICE_RAW_DEVICE_MODEL,
50  "passcodeLength",
51  "canWipeAfterLock",
52  "trackingInfo",
53  DEVICE_LOCATION,
54  "msg",
55  DEVICE_BATTERY_LEVEL,
56  "remoteWipe",
57  "thisDevice",
58  "snd",
59  DEVICE_PERSON_ID,
60  "wipeInProgress",
61  DEVICE_LOW_POWER_MODE,
62  "lostModeEnabled",
63  "isLocating",
64  DEVICE_LOST_MODE_CAPABLE,
65  "mesg",
66  DEVICE_NAME,
67  DEVICE_BATTERY_STATUS,
68  "lockedTimestamp",
69  "lostTimestamp",
70  "locationCapable",
71  DEVICE_DISPLAY_NAME,
72  "lostDevice",
73  "deviceColor",
74  "wipedTimestamp",
75  "modelDisplayName",
76  "locationEnabled",
77  "isMac",
78  "locFoundEnabled",
79 ]
80 
81 DEVICE_STATUS_CODES = {
82  "200": "online",
83  "201": "offline",
84  "203": "pending",
85  "204": "unregistered",
86 }