Migrate AdGuard Home to new entity naming style (#74999)
* Migrate AdGuard Home to new entity naming style * sentence-casing
This commit is contained in:
parent
ba18e11308
commit
7c2bd319f1
3 changed files with 16 additions and 18 deletions
|
@ -132,6 +132,8 @@ async def async_unload_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
|
||||||
class AdGuardHomeEntity(Entity):
|
class AdGuardHomeEntity(Entity):
|
||||||
"""Defines a base AdGuard Home entity."""
|
"""Defines a base AdGuard Home entity."""
|
||||||
|
|
||||||
|
_attr_has_entity_name = True
|
||||||
|
|
||||||
def __init__(
|
def __init__(
|
||||||
self,
|
self,
|
||||||
adguard: AdGuardHome,
|
adguard: AdGuardHome,
|
||||||
|
|
|
@ -100,7 +100,7 @@ class AdGuardHomeDNSQueriesSensor(AdGuardHomeSensor):
|
||||||
super().__init__(
|
super().__init__(
|
||||||
adguard,
|
adguard,
|
||||||
entry,
|
entry,
|
||||||
"AdGuard DNS Queries",
|
"DNS queries",
|
||||||
"mdi:magnify",
|
"mdi:magnify",
|
||||||
"dns_queries",
|
"dns_queries",
|
||||||
"queries",
|
"queries",
|
||||||
|
@ -119,7 +119,7 @@ class AdGuardHomeBlockedFilteringSensor(AdGuardHomeSensor):
|
||||||
super().__init__(
|
super().__init__(
|
||||||
adguard,
|
adguard,
|
||||||
entry,
|
entry,
|
||||||
"AdGuard DNS Queries Blocked",
|
"DNS queries blocked",
|
||||||
"mdi:magnify-close",
|
"mdi:magnify-close",
|
||||||
"blocked_filtering",
|
"blocked_filtering",
|
||||||
"queries",
|
"queries",
|
||||||
|
@ -139,7 +139,7 @@ class AdGuardHomePercentageBlockedSensor(AdGuardHomeSensor):
|
||||||
super().__init__(
|
super().__init__(
|
||||||
adguard,
|
adguard,
|
||||||
entry,
|
entry,
|
||||||
"AdGuard DNS Queries Blocked Ratio",
|
"DNS queries blocked ratio",
|
||||||
"mdi:magnify-close",
|
"mdi:magnify-close",
|
||||||
"blocked_percentage",
|
"blocked_percentage",
|
||||||
PERCENTAGE,
|
PERCENTAGE,
|
||||||
|
@ -159,7 +159,7 @@ class AdGuardHomeReplacedParentalSensor(AdGuardHomeSensor):
|
||||||
super().__init__(
|
super().__init__(
|
||||||
adguard,
|
adguard,
|
||||||
entry,
|
entry,
|
||||||
"AdGuard Parental Control Blocked",
|
"Parental control blocked",
|
||||||
"mdi:human-male-girl",
|
"mdi:human-male-girl",
|
||||||
"blocked_parental",
|
"blocked_parental",
|
||||||
"requests",
|
"requests",
|
||||||
|
@ -178,7 +178,7 @@ class AdGuardHomeReplacedSafeBrowsingSensor(AdGuardHomeSensor):
|
||||||
super().__init__(
|
super().__init__(
|
||||||
adguard,
|
adguard,
|
||||||
entry,
|
entry,
|
||||||
"AdGuard Safe Browsing Blocked",
|
"Safe browsing blocked",
|
||||||
"mdi:shield-half-full",
|
"mdi:shield-half-full",
|
||||||
"blocked_safebrowsing",
|
"blocked_safebrowsing",
|
||||||
"requests",
|
"requests",
|
||||||
|
@ -197,7 +197,7 @@ class AdGuardHomeReplacedSafeSearchSensor(AdGuardHomeSensor):
|
||||||
super().__init__(
|
super().__init__(
|
||||||
adguard,
|
adguard,
|
||||||
entry,
|
entry,
|
||||||
"AdGuard Safe Searches Enforced",
|
"Safe searches enforced",
|
||||||
"mdi:shield-search",
|
"mdi:shield-search",
|
||||||
"enforced_safesearch",
|
"enforced_safesearch",
|
||||||
"requests",
|
"requests",
|
||||||
|
@ -216,7 +216,7 @@ class AdGuardHomeAverageProcessingTimeSensor(AdGuardHomeSensor):
|
||||||
super().__init__(
|
super().__init__(
|
||||||
adguard,
|
adguard,
|
||||||
entry,
|
entry,
|
||||||
"AdGuard Average Processing Speed",
|
"Average processing speed",
|
||||||
"mdi:speedometer",
|
"mdi:speedometer",
|
||||||
"average_speed",
|
"average_speed",
|
||||||
TIME_MILLISECONDS,
|
TIME_MILLISECONDS,
|
||||||
|
@ -236,7 +236,7 @@ class AdGuardHomeRulesCountSensor(AdGuardHomeSensor):
|
||||||
super().__init__(
|
super().__init__(
|
||||||
adguard,
|
adguard,
|
||||||
entry,
|
entry,
|
||||||
"AdGuard Rules Count",
|
"Rules count",
|
||||||
"mdi:counter",
|
"mdi:counter",
|
||||||
"rules_count",
|
"rules_count",
|
||||||
"rules",
|
"rules",
|
||||||
|
|
|
@ -107,9 +107,7 @@ class AdGuardHomeProtectionSwitch(AdGuardHomeSwitch):
|
||||||
|
|
||||||
def __init__(self, adguard: AdGuardHome, entry: ConfigEntry) -> None:
|
def __init__(self, adguard: AdGuardHome, entry: ConfigEntry) -> None:
|
||||||
"""Initialize AdGuard Home switch."""
|
"""Initialize AdGuard Home switch."""
|
||||||
super().__init__(
|
super().__init__(adguard, entry, "Protection", "mdi:shield-check", "protection")
|
||||||
adguard, entry, "AdGuard Protection", "mdi:shield-check", "protection"
|
|
||||||
)
|
|
||||||
|
|
||||||
async def _adguard_turn_off(self) -> None:
|
async def _adguard_turn_off(self) -> None:
|
||||||
"""Turn off the switch."""
|
"""Turn off the switch."""
|
||||||
|
@ -130,7 +128,7 @@ class AdGuardHomeParentalSwitch(AdGuardHomeSwitch):
|
||||||
def __init__(self, adguard: AdGuardHome, entry: ConfigEntry) -> None:
|
def __init__(self, adguard: AdGuardHome, entry: ConfigEntry) -> None:
|
||||||
"""Initialize AdGuard Home switch."""
|
"""Initialize AdGuard Home switch."""
|
||||||
super().__init__(
|
super().__init__(
|
||||||
adguard, entry, "AdGuard Parental Control", "mdi:shield-check", "parental"
|
adguard, entry, "Parental control", "mdi:shield-check", "parental"
|
||||||
)
|
)
|
||||||
|
|
||||||
async def _adguard_turn_off(self) -> None:
|
async def _adguard_turn_off(self) -> None:
|
||||||
|
@ -152,7 +150,7 @@ class AdGuardHomeSafeSearchSwitch(AdGuardHomeSwitch):
|
||||||
def __init__(self, adguard: AdGuardHome, entry: ConfigEntry) -> None:
|
def __init__(self, adguard: AdGuardHome, entry: ConfigEntry) -> None:
|
||||||
"""Initialize AdGuard Home switch."""
|
"""Initialize AdGuard Home switch."""
|
||||||
super().__init__(
|
super().__init__(
|
||||||
adguard, entry, "AdGuard Safe Search", "mdi:shield-check", "safesearch"
|
adguard, entry, "Safe search", "mdi:shield-check", "safesearch"
|
||||||
)
|
)
|
||||||
|
|
||||||
async def _adguard_turn_off(self) -> None:
|
async def _adguard_turn_off(self) -> None:
|
||||||
|
@ -174,7 +172,7 @@ class AdGuardHomeSafeBrowsingSwitch(AdGuardHomeSwitch):
|
||||||
def __init__(self, adguard: AdGuardHome, entry: ConfigEntry) -> None:
|
def __init__(self, adguard: AdGuardHome, entry: ConfigEntry) -> None:
|
||||||
"""Initialize AdGuard Home switch."""
|
"""Initialize AdGuard Home switch."""
|
||||||
super().__init__(
|
super().__init__(
|
||||||
adguard, entry, "AdGuard Safe Browsing", "mdi:shield-check", "safebrowsing"
|
adguard, entry, "Safe browsing", "mdi:shield-check", "safebrowsing"
|
||||||
)
|
)
|
||||||
|
|
||||||
async def _adguard_turn_off(self) -> None:
|
async def _adguard_turn_off(self) -> None:
|
||||||
|
@ -195,9 +193,7 @@ class AdGuardHomeFilteringSwitch(AdGuardHomeSwitch):
|
||||||
|
|
||||||
def __init__(self, adguard: AdGuardHome, entry: ConfigEntry) -> None:
|
def __init__(self, adguard: AdGuardHome, entry: ConfigEntry) -> None:
|
||||||
"""Initialize AdGuard Home switch."""
|
"""Initialize AdGuard Home switch."""
|
||||||
super().__init__(
|
super().__init__(adguard, entry, "Filtering", "mdi:shield-check", "filtering")
|
||||||
adguard, entry, "AdGuard Filtering", "mdi:shield-check", "filtering"
|
|
||||||
)
|
|
||||||
|
|
||||||
async def _adguard_turn_off(self) -> None:
|
async def _adguard_turn_off(self) -> None:
|
||||||
"""Turn off the switch."""
|
"""Turn off the switch."""
|
||||||
|
@ -220,7 +216,7 @@ class AdGuardHomeQueryLogSwitch(AdGuardHomeSwitch):
|
||||||
super().__init__(
|
super().__init__(
|
||||||
adguard,
|
adguard,
|
||||||
entry,
|
entry,
|
||||||
"AdGuard Query Log",
|
"Query log",
|
||||||
"mdi:shield-check",
|
"mdi:shield-check",
|
||||||
"querylog",
|
"querylog",
|
||||||
enabled_default=False,
|
enabled_default=False,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue