1
mirror of https://github.com/home-assistant/core synced 2024-08-02 23:40:32 +02:00
ha-core/homeassistant/components/icloud/const.py
Niccolo Zapponi a775b79d4b
Add support for iCloud 2FA (#45818)
* Add support for iCloud 2FA

* Updated dependency for iCloud

* Updated dependency and logic fix

* Added logic for handling incorrect 2FA code

* Bug fix on failing test

* Added myself to codeowners

* Added check for 2FA on setup

* Updated error message
2021-02-03 19:18:31 +01:00

85 lines
1.9 KiB
Python

"""iCloud component constants."""
DOMAIN = "icloud"
CONF_WITH_FAMILY = "with_family"
CONF_MAX_INTERVAL = "max_interval"
CONF_GPS_ACCURACY_THRESHOLD = "gps_accuracy_threshold"
DEFAULT_WITH_FAMILY = False
DEFAULT_MAX_INTERVAL = 30 # min
DEFAULT_GPS_ACCURACY_THRESHOLD = 500 # meters
# to store the cookie
STORAGE_KEY = DOMAIN
STORAGE_VERSION = 2
PLATFORMS = ["device_tracker", "sensor"]
# pyicloud.AppleDevice status
DEVICE_BATTERY_LEVEL = "batteryLevel"
DEVICE_BATTERY_STATUS = "batteryStatus"
DEVICE_CLASS = "deviceClass"
DEVICE_DISPLAY_NAME = "deviceDisplayName"
DEVICE_ID = "id"
DEVICE_LOCATION = "location"
DEVICE_LOCATION_HORIZONTAL_ACCURACY = "horizontalAccuracy"
DEVICE_LOCATION_LATITUDE = "latitude"
DEVICE_LOCATION_LONGITUDE = "longitude"
DEVICE_LOST_MODE_CAPABLE = "lostModeCapable"
DEVICE_LOW_POWER_MODE = "lowPowerMode"
DEVICE_NAME = "name"
DEVICE_PERSON_ID = "prsId"
DEVICE_RAW_DEVICE_MODEL = "rawDeviceModel"
DEVICE_STATUS = "deviceStatus"
DEVICE_STATUS_SET = [
"features",
"maxMsgChar",
"darkWake",
"fmlyShare",
DEVICE_STATUS,
"remoteLock",
"activationLocked",
DEVICE_CLASS,
DEVICE_ID,
"deviceModel",
DEVICE_RAW_DEVICE_MODEL,
"passcodeLength",
"canWipeAfterLock",
"trackingInfo",
DEVICE_LOCATION,
"msg",
DEVICE_BATTERY_LEVEL,
"remoteWipe",
"thisDevice",
"snd",
DEVICE_PERSON_ID,
"wipeInProgress",
DEVICE_LOW_POWER_MODE,
"lostModeEnabled",
"isLocating",
DEVICE_LOST_MODE_CAPABLE,
"mesg",
DEVICE_NAME,
DEVICE_BATTERY_STATUS,
"lockedTimestamp",
"lostTimestamp",
"locationCapable",
DEVICE_DISPLAY_NAME,
"lostDevice",
"deviceColor",
"wipedTimestamp",
"modelDisplayName",
"locationEnabled",
"isMac",
"locFoundEnabled",
]
DEVICE_STATUS_CODES = {
"200": "online",
"201": "offline",
"203": "pending",
"204": "unregistered",
}