Files
home-assistant-core/homeassistant/components/icloud/const.py
T
Quentame c804f8f961 Add config flow to iCloud (#28968)
* iCloud: setup ConfigFlow and prepare for more platforms

- add config flow + tests
- fix existing services
- add play_sound & display_message services
- document services
- can use devices with the same name
- prepare to add sensor platform

* Review : not copy account conf

* Review: Safer test patch

* Review: remove reset_account

* Review: Use executor_job while IO

* Review: Use executor_job while IO 2

* Review: use hass.helpers.storage.Store()

* Review: no IO in tests

* Remove reset from services.yaml

* Review: remove authenticate.return_value = Mock()

* Review: do not initialize the api with the mocked service

* isort

* Review: @MartinHjelmare Test config flow with all steps

* Review: Fix failed tests names

* Codevov: Add one missing test
2019-12-09 17:19:42 +01:00

86 lines
1.9 KiB
Python

"""iCloud component constants."""
DOMAIN = "icloud"
TRACKER_UPDATE = f"{DOMAIN}_tracker_update"
CONF_ACCOUNT_NAME = "account_name"
CONF_MAX_INTERVAL = "max_interval"
CONF_GPS_ACCURACY_THRESHOLD = "gps_accuracy_threshold"
DEFAULT_MAX_INTERVAL = 30 # min
DEFAULT_GPS_ACCURACY_THRESHOLD = 500 # meters
# to store the cookie
STORAGE_KEY = DOMAIN
STORAGE_VERSION = 1
# Next PR will add sensor
ICLOUD_COMPONENTS = ["device_tracker"]
# 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",
}