mirror of
https://github.com/home-assistant/core.git
synced 2025-06-14 18:17:08 +00:00
Migrate DNSIP to new entity naming style (#75197)
This commit is contained in:
parent
06e905054e
commit
48f4b51a1d
@ -52,6 +52,7 @@ class WanIpSensor(SensorEntity):
|
||||
"""Implementation of a DNS IP sensor."""
|
||||
|
||||
_attr_icon = "mdi:web"
|
||||
_attr_has_entity_name = True
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
@ -61,7 +62,7 @@ class WanIpSensor(SensorEntity):
|
||||
ipv6: bool,
|
||||
) -> None:
|
||||
"""Initialize the DNS IP sensor."""
|
||||
self._attr_name = f"{name} IPv6" if ipv6 else name
|
||||
self._attr_name = "IPv6" if ipv6 else None
|
||||
self._attr_unique_id = f"{hostname}_{ipv6}"
|
||||
self.hostname = hostname
|
||||
self.resolver = aiodns.DNSResolver()
|
||||
@ -76,7 +77,7 @@ class WanIpSensor(SensorEntity):
|
||||
identifiers={(DOMAIN, f"{hostname}_{ipv6}")},
|
||||
manufacturer="DNS",
|
||||
model=aiodns.__version__,
|
||||
name=hostname,
|
||||
name=name,
|
||||
)
|
||||
|
||||
async def async_update(self) -> None:
|
||||
|
Loading…
x
Reference in New Issue
Block a user