Remove obsolete "Domains blocked" extra attribute from PI-Hole sensors (#85424)

remove obsolete "domains blocked" extra attribute
This commit is contained in:
Michael 2023-01-08 13:25:37 +01:00 committed by GitHub
parent 5d6634906d
commit 30c9f4f926
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 1 additions and 12 deletions

View file

@ -15,7 +15,6 @@ DEFAULT_STATISTICS_ONLY = True
SERVICE_DISABLE = "disable"
SERVICE_DISABLE_ATTR_DURATION = "duration"
ATTR_BLOCKED_DOMAINS = "domains_blocked"
MIN_TIME_BETWEEN_UPDATES = timedelta(minutes=5)
DATA_KEY_API = "api"

View file

@ -13,12 +13,7 @@ from homeassistant.helpers.entity_platform import AddEntitiesCallback
from homeassistant.helpers.update_coordinator import DataUpdateCoordinator
from . import PiHoleEntity
from .const import (
ATTR_BLOCKED_DOMAINS,
DATA_KEY_API,
DATA_KEY_COORDINATOR,
DOMAIN as PIHOLE_DOMAIN,
)
from .const import DATA_KEY_API, DATA_KEY_COORDINATOR, DOMAIN as PIHOLE_DOMAIN
SENSOR_TYPES: tuple[SensorEntityDescription, ...] = (
SensorEntityDescription(
@ -124,8 +119,3 @@ class PiHoleSensor(PiHoleEntity, SensorEntity):
return round(self.api.data[self.entity_description.key], 2)
except TypeError:
return self.api.data[self.entity_description.key]
@property
def extra_state_attributes(self) -> dict[str, Any]:
"""Return the state attributes of the Pi-hole."""
return {ATTR_BLOCKED_DOMAINS: self.api.data["domains_being_blocked"]}