diff --git a/homeassistant/components/adguard/sensor.py b/homeassistant/components/adguard/sensor.py index f24aa20d28d..9f1c0a5b0fe 100644 --- a/homeassistant/components/adguard/sensor.py +++ b/homeassistant/components/adguard/sensor.py @@ -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), diff --git a/homeassistant/components/adguard/strings.json b/homeassistant/components/adguard/strings.json index e593d4199a4..bde73e82b37 100644 --- a/homeassistant/components/adguard/strings.json +++ b/homeassistant/components/adguard/strings.json @@ -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" + } + } } } diff --git a/homeassistant/components/adguard/switch.py b/homeassistant/components/adguard/switch.py index a359bf86c2d..1020e8690f1 100644 --- a/homeassistant/components/adguard/switch.py +++ b/homeassistant/components/adguard/switch.py @@ -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,