From 30c9f4f9266254baddfac75c1d3c692b9b355e1d Mon Sep 17 00:00:00 2001 From: Michael <35783820+mib1185@users.noreply.github.com> Date: Sun, 8 Jan 2023 13:25:37 +0100 Subject: [PATCH] Remove obsolete "Domains blocked" extra attribute from PI-Hole sensors (#85424) remove obsolete "domains blocked" extra attribute --- homeassistant/components/pi_hole/const.py | 1 - homeassistant/components/pi_hole/sensor.py | 12 +----------- 2 files changed, 1 insertion(+), 12 deletions(-) diff --git a/homeassistant/components/pi_hole/const.py b/homeassistant/components/pi_hole/const.py index 1e545ad77db..0114a6621b5 100644 --- a/homeassistant/components/pi_hole/const.py +++ b/homeassistant/components/pi_hole/const.py @@ -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" diff --git a/homeassistant/components/pi_hole/sensor.py b/homeassistant/components/pi_hole/sensor.py index eea1c3b9656..dbca8661377 100644 --- a/homeassistant/components/pi_hole/sensor.py +++ b/homeassistant/components/pi_hole/sensor.py @@ -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"]}