1 """AdGuard Home base entity."""
3 from __future__
import annotations
5 from adguardhome
import AdGuardHomeError
11 from .
import AdGuardConfigEntry, AdGuardData
12 from .const
import DOMAIN, LOGGER
16 """Defines a base AdGuard Home entity."""
18 _attr_has_entity_name =
True
19 _attr_available =
True
24 entry: AdGuardConfigEntry,
26 """Initialize the AdGuard Home entity."""
32 """Update AdGuard Home entity."""
39 except AdGuardHomeError:
42 "An error occurred while updating AdGuard Home sensor",
48 """Update AdGuard Home entity."""
49 raise NotImplementedError
53 """Return device information about this AdGuard Home instance."""
54 if self.
_entry_entry.source == SOURCE_HASSIO:
55 config_url =
"homeassistant://hassio/ingress/a0d7b954_adguard"
57 config_url = f
"https://{self.adguard.host}:{self.adguard.port}"
59 config_url = f
"http://{self.adguard.host}:{self.adguard.port}"
62 entry_type=DeviceEntryType.SERVICE,
71 manufacturer=
"AdGuard Team",
73 sw_version=self.
datadata.version,
74 configuration_url=config_url,
DeviceInfo device_info(self)
None _adguard_update(self)
None __init__(self, AdGuardData data, AdGuardConfigEntry entry)