2019-02-04 08:47:04 +00:00
|
|
|
"""Consts used by Speedtest.net."""
|
2020-02-23 20:09:24 +00:00
|
|
|
from homeassistant.const import DATA_RATE_MEGABITS_PER_SECOND, TIME_MILLISECONDS
|
2020-02-13 16:52:58 +00:00
|
|
|
|
2019-07-31 19:25:30 +00:00
|
|
|
DOMAIN = "speedtestdotnet"
|
2020-06-10 16:33:48 +00:00
|
|
|
|
|
|
|
SPEED_TEST_SERVICE = "speedtest"
|
2019-09-03 19:14:39 +00:00
|
|
|
DATA_UPDATED = f"{DOMAIN}_data_updated"
|
2019-02-04 08:47:04 +00:00
|
|
|
|
|
|
|
SENSOR_TYPES = {
|
2020-02-23 20:09:24 +00:00
|
|
|
"ping": ["Ping", TIME_MILLISECONDS],
|
2020-02-13 16:52:58 +00:00
|
|
|
"download": ["Download", DATA_RATE_MEGABITS_PER_SECOND],
|
|
|
|
"upload": ["Upload", DATA_RATE_MEGABITS_PER_SECOND],
|
2019-02-04 08:47:04 +00:00
|
|
|
}
|
2020-06-10 16:33:48 +00:00
|
|
|
|
|
|
|
CONF_SERVER_NAME = "server_name"
|
|
|
|
CONF_SERVER_ID = "server_id"
|
|
|
|
CONF_MANUAL = "manual"
|
|
|
|
|
|
|
|
ATTR_BYTES_RECEIVED = "bytes_received"
|
|
|
|
ATTR_BYTES_SENT = "bytes_sent"
|
|
|
|
ATTR_SERVER_COUNTRY = "server_country"
|
|
|
|
ATTR_SERVER_ID = "server_id"
|
|
|
|
ATTR_SERVER_NAME = "server_name"
|
|
|
|
|
|
|
|
|
|
|
|
DEFAULT_NAME = "SpeedTest"
|
|
|
|
DEFAULT_SCAN_INTERVAL = 60
|
|
|
|
DEFAULT_SERVER = "*Auto Detect"
|
|
|
|
|
|
|
|
ATTRIBUTION = "Data retrieved from Speedtest.net by Ookla"
|
|
|
|
|
|
|
|
ICON = "mdi:speedometer"
|