* Convert life360 integration to entity based * Improve config_flow.py type checking * Add tests for config flow Fix form defaults for reauth flow. * Cover reauth when config entry loaded * Update per review (except for dataclasses) * Restore check for missing location information This is in current code but was accidentally removed in this PR. * Fix updates from review * Update tests per review changes * Change IntegData to a dataclass * Use dataclasses to represent fetched Life360 data * Always add extra attributes * Update per review take 2 * Tweak handling of bad last_seen or location_accuracy * Fix type of Life360Member.gps_accuracy * Update per review take 3 * Update .coveragerc * Parametrize successful reauth flow test * Fix test coverage failure * Update per review take 4 * Fix config schema
42 lines
1 KiB
Python
42 lines
1 KiB
Python
"""Constants for Life360 integration."""
|
|
|
|
from datetime import timedelta
|
|
import logging
|
|
|
|
DOMAIN = "life360"
|
|
LOGGER = logging.getLogger(__package__)
|
|
|
|
ATTRIBUTION = "Data provided by life360.com"
|
|
COMM_MAX_RETRIES = 2
|
|
COMM_TIMEOUT = 3.05
|
|
SPEED_FACTOR_MPH = 2.25
|
|
SPEED_DIGITS = 1
|
|
UPDATE_INTERVAL = timedelta(seconds=10)
|
|
|
|
ATTR_ADDRESS = "address"
|
|
ATTR_AT_LOC_SINCE = "at_loc_since"
|
|
ATTR_DRIVING = "driving"
|
|
ATTR_LAST_SEEN = "last_seen"
|
|
ATTR_PLACE = "place"
|
|
ATTR_SPEED = "speed"
|
|
ATTR_WIFI_ON = "wifi_on"
|
|
|
|
CONF_AUTHORIZATION = "authorization"
|
|
CONF_CIRCLES = "circles"
|
|
CONF_DRIVING_SPEED = "driving_speed"
|
|
CONF_ERROR_THRESHOLD = "error_threshold"
|
|
CONF_MAX_GPS_ACCURACY = "max_gps_accuracy"
|
|
CONF_MAX_UPDATE_WAIT = "max_update_wait"
|
|
CONF_MEMBERS = "members"
|
|
CONF_SHOW_AS_STATE = "show_as_state"
|
|
CONF_WARNING_THRESHOLD = "warning_threshold"
|
|
|
|
SHOW_DRIVING = "driving"
|
|
SHOW_MOVING = "moving"
|
|
|
|
DEFAULT_OPTIONS = {
|
|
CONF_DRIVING_SPEED: None,
|
|
CONF_MAX_GPS_ACCURACY: None,
|
|
SHOW_DRIVING: False,
|
|
}
|
|
OPTIONS = list(DEFAULT_OPTIONS.keys())
|