diff --git a/homeassistant/components/pi_hole/__init__.py b/homeassistant/components/pi_hole/__init__.py index ddd4f77fa36..5c679a4839a 100644 --- a/homeassistant/components/pi_hole/__init__.py +++ b/homeassistant/components/pi_hole/__init__.py @@ -161,8 +161,6 @@ def _async_platforms(entry: ConfigEntry) -> list[str]: class PiHoleEntity(CoordinatorEntity): """Representation of a Pi-hole entity.""" - _attr_icon: str = "mdi:pi-hole" - def __init__( self, api: Hole, diff --git a/homeassistant/components/pi_hole/binary_sensor.py b/homeassistant/components/pi_hole/binary_sensor.py index 3c322d324d3..5758c0e4145 100644 --- a/homeassistant/components/pi_hole/binary_sensor.py +++ b/homeassistant/components/pi_hole/binary_sensor.py @@ -29,6 +29,8 @@ async def async_setup_entry( class PiHoleBinarySensor(PiHoleEntity, BinarySensorEntity): """Representation of a Pi-hole binary sensor.""" + _attr_icon = "mdi:pi-hole" + @property def name(self) -> str: """Return the name of the sensor.""" diff --git a/homeassistant/components/pi_hole/sensor.py b/homeassistant/components/pi_hole/sensor.py index 242f7a3a742..14aed86a479 100644 --- a/homeassistant/components/pi_hole/sensor.py +++ b/homeassistant/components/pi_hole/sensor.py @@ -61,7 +61,6 @@ class PiHoleSensor(PiHoleEntity, SensorEntity): self._attr_name = f"{name} {description.name}" self._attr_unique_id = f"{self._server_unique_id}/{description.name}" - self._attr_icon = description.icon # Necessary to overwrite inherited value @property def state(self) -> Any: diff --git a/homeassistant/components/pi_hole/switch.py b/homeassistant/components/pi_hole/switch.py index b0c4b09c2e7..dc699beb26b 100644 --- a/homeassistant/components/pi_hole/switch.py +++ b/homeassistant/components/pi_hole/switch.py @@ -58,6 +58,8 @@ async def async_setup_entry( class PiHoleSwitch(PiHoleEntity, SwitchEntity): """Representation of a Pi-hole switch.""" + _attr_icon = "mdi:pi-hole" + @property def name(self) -> str: """Return the name of the switch.""" @@ -68,11 +70,6 @@ class PiHoleSwitch(PiHoleEntity, SwitchEntity): """Return the unique id of the switch.""" return f"{self._server_unique_id}/Switch" - @property - def icon(self) -> str: - """Icon to use in the frontend, if any.""" - return "mdi:pi-hole" - @property def is_on(self) -> bool: """Return if the service is on."""