From aeeadb570a2d3dbfb758d765b00f046a23bf77fc Mon Sep 17 00:00:00 2001 From: Michael <35783820+mib1185@users.noreply.github.com> Date: Mon, 3 Apr 2023 16:38:54 +0200 Subject: [PATCH] Fix translation of status binary sensor in PI-Hole (#90719) --- homeassistant/components/pi_hole/binary_sensor.py | 4 ---- tests/components/pi_hole/test_init.py | 4 ++-- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/homeassistant/components/pi_hole/binary_sensor.py b/homeassistant/components/pi_hole/binary_sensor.py index 3a90e6fc78b..7ec1bf40c66 100644 --- a/homeassistant/components/pi_hole/binary_sensor.py +++ b/homeassistant/components/pi_hole/binary_sensor.py @@ -122,10 +122,6 @@ class PiHoleBinarySensor(PiHoleEntity, BinarySensorEntity): """Initialize a Pi-hole sensor.""" super().__init__(api, coordinator, name, server_unique_id) self.entity_description = description - - if description.key == "status": - self._attr_has_entity_name = False - self._attr_name = f"{name}" self._attr_unique_id = f"{self._server_unique_id}/{description.key}" @property diff --git a/tests/components/pi_hole/test_init.py b/tests/components/pi_hole/test_init.py index 29402a06f75..b0b71fe13ed 100644 --- a/tests/components/pi_hole/test_init.py +++ b/tests/components/pi_hole/test_init.py @@ -71,8 +71,8 @@ async def test_setup_with_defaults(hass: HomeAssistant) -> None: assert state.name == "Pi-Hole Seen clients" assert state.state == "0" - state = hass.states.get("binary_sensor.pi_hole") - assert state.name == "Pi-Hole" + state = hass.states.get("binary_sensor.pi_hole_status") + assert state.name == "Pi-Hole Status" assert state.state == "off"