mirror of
https://github.com/home-assistant/core.git
synced 2025-11-09 02:49:40 +00:00
Various cleanups in AdGuard Home (#75250)
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
This commit is contained in:
@@ -15,8 +15,8 @@ from homeassistant.core import HomeAssistant
|
||||
from homeassistant.exceptions import PlatformNotReady
|
||||
from homeassistant.helpers.entity_platform import AddEntitiesCallback
|
||||
|
||||
from . import AdGuardHomeDeviceEntity
|
||||
from .const import DATA_ADGUARD_CLIENT, DATA_ADGUARD_VERSION, DOMAIN
|
||||
from .entity import AdGuardHomeEntity
|
||||
|
||||
SCAN_INTERVAL = timedelta(seconds=300)
|
||||
PARALLEL_UPDATES = 4
|
||||
@@ -118,7 +118,7 @@ async def async_setup_entry(
|
||||
)
|
||||
|
||||
|
||||
class AdGuardHomeSensor(AdGuardHomeDeviceEntity, SensorEntity):
|
||||
class AdGuardHomeSensor(AdGuardHomeEntity, SensorEntity):
|
||||
"""Defines a AdGuard Home sensor."""
|
||||
|
||||
entity_description: AdGuardHomeEntityDescription
|
||||
@@ -130,8 +130,8 @@ class AdGuardHomeSensor(AdGuardHomeDeviceEntity, SensorEntity):
|
||||
description: AdGuardHomeEntityDescription,
|
||||
) -> None:
|
||||
"""Initialize AdGuard Home sensor."""
|
||||
super().__init__(adguard, entry)
|
||||
self.entity_description = description
|
||||
|
||||
self._attr_unique_id = "_".join(
|
||||
[
|
||||
DOMAIN,
|
||||
@@ -142,14 +142,6 @@ class AdGuardHomeSensor(AdGuardHomeDeviceEntity, SensorEntity):
|
||||
]
|
||||
)
|
||||
|
||||
super().__init__(
|
||||
adguard,
|
||||
entry,
|
||||
description.name,
|
||||
description.icon,
|
||||
description.entity_registry_enabled_default,
|
||||
)
|
||||
|
||||
async def _adguard_update(self) -> None:
|
||||
"""Update AdGuard Home entity."""
|
||||
value = await self.entity_description.value_fn(self.adguard)()
|
||||
|
||||
Reference in New Issue
Block a user