Add icon translations to Adguard (#108406)
This commit is contained in:
parent
9d380cea21
commit
62fe9144f1
3 changed files with 75 additions and 14 deletions
75
homeassistant/components/adguard/icons.json
Normal file
75
homeassistant/components/adguard/icons.json
Normal file
|
@ -0,0 +1,75 @@
|
|||
{
|
||||
"entity": {
|
||||
"sensor": {
|
||||
"dns_queries": {
|
||||
"default": "mdi:magnify"
|
||||
},
|
||||
"dns_queries_blocked": {
|
||||
"default": "mdi:magnify-close"
|
||||
},
|
||||
"dns_queries_blocked_ratio": {
|
||||
"default": "mdi:magnify-close"
|
||||
},
|
||||
"parental_control_blocked": {
|
||||
"default": "mdi:human-male-girl"
|
||||
},
|
||||
"safe_browsing_blocked": {
|
||||
"default": "mdi:shield-half-full"
|
||||
},
|
||||
"safe_searches_enforced": {
|
||||
"default": "mdi:shield-search"
|
||||
},
|
||||
"average_processing_speed": {
|
||||
"default": "mdi:speedometer"
|
||||
},
|
||||
"rules_count": {
|
||||
"default": "mdi:counter"
|
||||
}
|
||||
},
|
||||
"switch": {
|
||||
"protection": {
|
||||
"default": "mdi:shield-check",
|
||||
"state": {
|
||||
"off": "mdi:shield-off"
|
||||
}
|
||||
},
|
||||
"parental": {
|
||||
"default": "mdi:shield-check",
|
||||
"state": {
|
||||
"off": "mdi:shield-off"
|
||||
}
|
||||
},
|
||||
"safe_search": {
|
||||
"default": "mdi:shield-check",
|
||||
"state": {
|
||||
"off": "mdi:shield-off"
|
||||
}
|
||||
},
|
||||
"safe_browsing": {
|
||||
"default": "mdi:shield-check",
|
||||
"state": {
|
||||
"off": "mdi:shield-off"
|
||||
}
|
||||
},
|
||||
"filtering": {
|
||||
"default": "mdi:shield-check",
|
||||
"state": {
|
||||
"off": "mdi:shield-off"
|
||||
}
|
||||
},
|
||||
"query_log": {
|
||||
"default": "mdi:shield-check",
|
||||
"state": {
|
||||
"off": "mdi:shield-off"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"services": {
|
||||
"add_url": "mdi:link-plus",
|
||||
"remove_url": "mdi:link-off",
|
||||
"enable_url": "mdi:link-variant",
|
||||
"disable_url": "mdi:link-variant-off",
|
||||
"refresh": "mdi:refresh"
|
||||
}
|
||||
}
|
|
@ -33,56 +33,48 @@ SENSORS: tuple[AdGuardHomeEntityDescription, ...] = (
|
|||
AdGuardHomeEntityDescription(
|
||||
key="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",
|
||||
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",
|
||||
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",
|
||||
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",
|
||||
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",
|
||||
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",
|
||||
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",
|
||||
translation_key="rules_count",
|
||||
icon="mdi:counter",
|
||||
native_unit_of_measurement="rules",
|
||||
value_fn=lambda adguard: adguard.filtering.rules_count(allowlist=False),
|
||||
entity_registry_enabled_default=False,
|
||||
|
|
|
@ -34,7 +34,6 @@ SWITCHES: tuple[AdGuardHomeSwitchEntityDescription, ...] = (
|
|||
AdGuardHomeSwitchEntityDescription(
|
||||
key="protection",
|
||||
translation_key="protection",
|
||||
icon="mdi:shield-check",
|
||||
is_on_fn=lambda adguard: adguard.protection_enabled,
|
||||
turn_on_fn=lambda adguard: adguard.enable_protection,
|
||||
turn_off_fn=lambda adguard: adguard.disable_protection,
|
||||
|
@ -42,7 +41,6 @@ SWITCHES: tuple[AdGuardHomeSwitchEntityDescription, ...] = (
|
|||
AdGuardHomeSwitchEntityDescription(
|
||||
key="parental",
|
||||
translation_key="parental",
|
||||
icon="mdi:shield-check",
|
||||
is_on_fn=lambda adguard: adguard.parental.enabled,
|
||||
turn_on_fn=lambda adguard: adguard.parental.enable,
|
||||
turn_off_fn=lambda adguard: adguard.parental.disable,
|
||||
|
@ -50,7 +48,6 @@ SWITCHES: tuple[AdGuardHomeSwitchEntityDescription, ...] = (
|
|||
AdGuardHomeSwitchEntityDescription(
|
||||
key="safesearch",
|
||||
translation_key="safe_search",
|
||||
icon="mdi:shield-check",
|
||||
is_on_fn=lambda adguard: adguard.safesearch.enabled,
|
||||
turn_on_fn=lambda adguard: adguard.safesearch.enable,
|
||||
turn_off_fn=lambda adguard: adguard.safesearch.disable,
|
||||
|
@ -58,7 +55,6 @@ SWITCHES: tuple[AdGuardHomeSwitchEntityDescription, ...] = (
|
|||
AdGuardHomeSwitchEntityDescription(
|
||||
key="safebrowsing",
|
||||
translation_key="safe_browsing",
|
||||
icon="mdi:shield-check",
|
||||
is_on_fn=lambda adguard: adguard.safebrowsing.enabled,
|
||||
turn_on_fn=lambda adguard: adguard.safebrowsing.enable,
|
||||
turn_off_fn=lambda adguard: adguard.safebrowsing.disable,
|
||||
|
@ -66,7 +62,6 @@ SWITCHES: tuple[AdGuardHomeSwitchEntityDescription, ...] = (
|
|||
AdGuardHomeSwitchEntityDescription(
|
||||
key="filtering",
|
||||
translation_key="filtering",
|
||||
icon="mdi:shield-check",
|
||||
is_on_fn=lambda adguard: adguard.filtering.enabled,
|
||||
turn_on_fn=lambda adguard: adguard.filtering.enable,
|
||||
turn_off_fn=lambda adguard: adguard.filtering.disable,
|
||||
|
@ -74,7 +69,6 @@ SWITCHES: tuple[AdGuardHomeSwitchEntityDescription, ...] = (
|
|||
AdGuardHomeSwitchEntityDescription(
|
||||
key="querylog",
|
||||
translation_key="query_log",
|
||||
icon="mdi:shield-check",
|
||||
is_on_fn=lambda adguard: adguard.querylog.enabled,
|
||||
turn_on_fn=lambda adguard: adguard.querylog.enable,
|
||||
turn_off_fn=lambda adguard: adguard.querylog.disable,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue