2020-01-31 16:33:00 +00:00
|
|
|
"""Constants for the pi_hole integration."""
|
2019-09-03 23:18:06 +00:00
|
|
|
from datetime import timedelta
|
|
|
|
|
2020-02-28 19:46:48 +00:00
|
|
|
from homeassistant.const import UNIT_PERCENTAGE
|
|
|
|
|
2019-09-03 23:18:06 +00:00
|
|
|
DOMAIN = "pi_hole"
|
|
|
|
|
|
|
|
CONF_LOCATION = "location"
|
|
|
|
|
|
|
|
DEFAULT_LOCATION = "admin"
|
|
|
|
DEFAULT_METHOD = "GET"
|
|
|
|
DEFAULT_NAME = "Pi-Hole"
|
|
|
|
DEFAULT_SSL = False
|
|
|
|
DEFAULT_VERIFY_SSL = True
|
|
|
|
|
2019-09-30 00:35:56 +00:00
|
|
|
SERVICE_DISABLE = "disable"
|
|
|
|
SERVICE_DISABLE_ATTR_DURATION = "duration"
|
|
|
|
|
2019-09-03 23:18:06 +00:00
|
|
|
ATTR_BLOCKED_DOMAINS = "domains_blocked"
|
|
|
|
|
|
|
|
MIN_TIME_BETWEEN_UPDATES = timedelta(minutes=5)
|
|
|
|
|
2020-06-23 01:47:37 +00:00
|
|
|
DATA_KEY_API = "api"
|
|
|
|
DATA_KEY_COORDINATOR = "coordinator"
|
|
|
|
|
2019-09-03 23:18:06 +00:00
|
|
|
SENSOR_DICT = {
|
|
|
|
"ads_blocked_today": ["Ads Blocked Today", "ads", "mdi:close-octagon-outline"],
|
|
|
|
"ads_percentage_today": [
|
|
|
|
"Ads Percentage Blocked Today",
|
2020-02-28 19:46:48 +00:00
|
|
|
UNIT_PERCENTAGE,
|
2019-09-03 23:18:06 +00:00
|
|
|
"mdi:close-octagon-outline",
|
|
|
|
],
|
|
|
|
"clients_ever_seen": ["Seen Clients", "clients", "mdi:account-outline"],
|
|
|
|
"dns_queries_today": [
|
|
|
|
"DNS Queries Today",
|
|
|
|
"queries",
|
|
|
|
"mdi:comment-question-outline",
|
|
|
|
],
|
|
|
|
"domains_being_blocked": ["Domains Blocked", "domains", "mdi:block-helper"],
|
|
|
|
"queries_cached": ["DNS Queries Cached", "queries", "mdi:comment-question-outline"],
|
|
|
|
"queries_forwarded": [
|
|
|
|
"DNS Queries Forwarded",
|
|
|
|
"queries",
|
|
|
|
"mdi:comment-question-outline",
|
|
|
|
],
|
|
|
|
"unique_clients": ["DNS Unique Clients", "clients", "mdi:account-outline"],
|
|
|
|
"unique_domains": ["DNS Unique Domains", "domains", "mdi:domain"],
|
|
|
|
}
|
|
|
|
|
|
|
|
SENSOR_LIST = list(SENSOR_DICT)
|