mirror of
https://github.com/home-assistant/core.git
synced 2025-04-25 09:47:52 +00:00
Add entity translations for Adguard (#94171)
This commit is contained in:
parent
b254218dd6
commit
30453f6982
@ -39,56 +39,56 @@ class AdGuardHomeEntityDescription(
|
||||
SENSORS: tuple[AdGuardHomeEntityDescription, ...] = (
|
||||
AdGuardHomeEntityDescription(
|
||||
key="dns_queries",
|
||||
name="DNS queries",
|
||||
translation_key="dns_queries",
|
||||
icon="mdi:magnify",
|
||||
native_unit_of_measurement="queries",
|
||||
value_fn=lambda adguard: adguard.stats.dns_queries(),
|
||||
),
|
||||
AdGuardHomeEntityDescription(
|
||||
key="blocked_filtering",
|
||||
name="DNS queries blocked",
|
||||
translation_key="dns_queries_blocked",
|
||||
icon="mdi:magnify-close",
|
||||
native_unit_of_measurement="queries",
|
||||
value_fn=lambda adguard: adguard.stats.blocked_filtering(),
|
||||
),
|
||||
AdGuardHomeEntityDescription(
|
||||
key="blocked_percentage",
|
||||
name="DNS queries blocked ratio",
|
||||
translation_key="dns_queries_blocked_ratio",
|
||||
icon="mdi:magnify-close",
|
||||
native_unit_of_measurement=PERCENTAGE,
|
||||
value_fn=lambda adguard: adguard.stats.blocked_percentage(),
|
||||
),
|
||||
AdGuardHomeEntityDescription(
|
||||
key="blocked_parental",
|
||||
name="Parental control blocked",
|
||||
translation_key="parental_control_blocked",
|
||||
icon="mdi:human-male-girl",
|
||||
native_unit_of_measurement="requests",
|
||||
value_fn=lambda adguard: adguard.stats.replaced_parental(),
|
||||
),
|
||||
AdGuardHomeEntityDescription(
|
||||
key="blocked_safebrowsing",
|
||||
name="Safe browsing blocked",
|
||||
translation_key="safe_browsing_blocked",
|
||||
icon="mdi:shield-half-full",
|
||||
native_unit_of_measurement="requests",
|
||||
value_fn=lambda adguard: adguard.stats.replaced_safebrowsing(),
|
||||
),
|
||||
AdGuardHomeEntityDescription(
|
||||
key="enforced_safesearch",
|
||||
name="Safe searches enforced",
|
||||
translation_key="safe_searches_enforced",
|
||||
icon="mdi:shield-search",
|
||||
native_unit_of_measurement="requests",
|
||||
value_fn=lambda adguard: adguard.stats.replaced_safesearch(),
|
||||
),
|
||||
AdGuardHomeEntityDescription(
|
||||
key="average_speed",
|
||||
name="Average processing speed",
|
||||
translation_key="average_processing_speed",
|
||||
icon="mdi:speedometer",
|
||||
native_unit_of_measurement=UnitOfTime.MILLISECONDS,
|
||||
value_fn=lambda adguard: adguard.stats.avg_processing_time(),
|
||||
),
|
||||
AdGuardHomeEntityDescription(
|
||||
key="rules_count",
|
||||
name="Rules count",
|
||||
translation_key="rules_count",
|
||||
icon="mdi:counter",
|
||||
native_unit_of_measurement="rules",
|
||||
value_fn=lambda adguard: adguard.filtering.rules_count(allowlist=False),
|
||||
|
@ -24,5 +24,53 @@
|
||||
"existing_instance_updated": "Updated existing configuration.",
|
||||
"already_configured": "[%key:common::config_flow::abort::already_configured_service%]"
|
||||
}
|
||||
},
|
||||
"entity": {
|
||||
"sensor": {
|
||||
"dns_queries": {
|
||||
"name": "DNS queries"
|
||||
},
|
||||
"dns_queries_blocked": {
|
||||
"name": "DNS queries blocked"
|
||||
},
|
||||
"dns_queries_blocked_ratio": {
|
||||
"name": "DNS queries blocked ratio"
|
||||
},
|
||||
"parental_control_blocked": {
|
||||
"name": "Parental control blocked"
|
||||
},
|
||||
"safe_browsing_blocked": {
|
||||
"name": "Safe browsing blocked"
|
||||
},
|
||||
"safe_searches_enforced": {
|
||||
"name": "Safe searches enforced"
|
||||
},
|
||||
"average_processing_speed": {
|
||||
"name": "Average processing speed"
|
||||
},
|
||||
"rules_count": {
|
||||
"name": "Rules count"
|
||||
}
|
||||
},
|
||||
"switch": {
|
||||
"protection": {
|
||||
"name": "Protection"
|
||||
},
|
||||
"parental": {
|
||||
"name": "Parental control"
|
||||
},
|
||||
"safe_search": {
|
||||
"name": "Safe search"
|
||||
},
|
||||
"safe_browsing": {
|
||||
"name": "Safe browsing"
|
||||
},
|
||||
"filtering": {
|
||||
"name": "Filtering"
|
||||
},
|
||||
"query_log": {
|
||||
"name": "Query log"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -40,7 +40,7 @@ class AdGuardHomeSwitchEntityDescription(
|
||||
SWITCHES: tuple[AdGuardHomeSwitchEntityDescription, ...] = (
|
||||
AdGuardHomeSwitchEntityDescription(
|
||||
key="protection",
|
||||
name="Protection",
|
||||
translation_key="protection",
|
||||
icon="mdi:shield-check",
|
||||
is_on_fn=lambda adguard: adguard.protection_enabled,
|
||||
turn_on_fn=lambda adguard: adguard.enable_protection,
|
||||
@ -48,7 +48,7 @@ SWITCHES: tuple[AdGuardHomeSwitchEntityDescription, ...] = (
|
||||
),
|
||||
AdGuardHomeSwitchEntityDescription(
|
||||
key="parental",
|
||||
name="Parental control",
|
||||
translation_key="parental",
|
||||
icon="mdi:shield-check",
|
||||
is_on_fn=lambda adguard: adguard.parental.enabled,
|
||||
turn_on_fn=lambda adguard: adguard.parental.enable,
|
||||
@ -56,7 +56,7 @@ SWITCHES: tuple[AdGuardHomeSwitchEntityDescription, ...] = (
|
||||
),
|
||||
AdGuardHomeSwitchEntityDescription(
|
||||
key="safesearch",
|
||||
name="Safe search",
|
||||
translation_key="safe_search",
|
||||
icon="mdi:shield-check",
|
||||
is_on_fn=lambda adguard: adguard.safesearch.enabled,
|
||||
turn_on_fn=lambda adguard: adguard.safesearch.enable,
|
||||
@ -64,7 +64,7 @@ SWITCHES: tuple[AdGuardHomeSwitchEntityDescription, ...] = (
|
||||
),
|
||||
AdGuardHomeSwitchEntityDescription(
|
||||
key="safebrowsing",
|
||||
name="Safe browsing",
|
||||
translation_key="safe_browsing",
|
||||
icon="mdi:shield-check",
|
||||
is_on_fn=lambda adguard: adguard.safebrowsing.enabled,
|
||||
turn_on_fn=lambda adguard: adguard.safebrowsing.enable,
|
||||
@ -72,7 +72,7 @@ SWITCHES: tuple[AdGuardHomeSwitchEntityDescription, ...] = (
|
||||
),
|
||||
AdGuardHomeSwitchEntityDescription(
|
||||
key="filtering",
|
||||
name="Filtering",
|
||||
translation_key="filtering",
|
||||
icon="mdi:shield-check",
|
||||
is_on_fn=lambda adguard: adguard.filtering.enabled,
|
||||
turn_on_fn=lambda adguard: adguard.filtering.enable,
|
||||
@ -80,7 +80,7 @@ SWITCHES: tuple[AdGuardHomeSwitchEntityDescription, ...] = (
|
||||
),
|
||||
AdGuardHomeSwitchEntityDescription(
|
||||
key="querylog",
|
||||
name="Query log",
|
||||
translation_key="query_log",
|
||||
icon="mdi:shield-check",
|
||||
is_on_fn=lambda adguard: adguard.querylog.enabled,
|
||||
turn_on_fn=lambda adguard: adguard.querylog.enable,
|
||||
|
Loading…
x
Reference in New Issue
Block a user