Fix translation of status binary sensor in PI-Hole (#90719)
parent
4456557a02
commit
aeeadb570a
|
@ -122,10 +122,6 @@ class PiHoleBinarySensor(PiHoleEntity, BinarySensorEntity):
|
||||||
"""Initialize a Pi-hole sensor."""
|
"""Initialize a Pi-hole sensor."""
|
||||||
super().__init__(api, coordinator, name, server_unique_id)
|
super().__init__(api, coordinator, name, server_unique_id)
|
||||||
self.entity_description = description
|
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}"
|
self._attr_unique_id = f"{self._server_unique_id}/{description.key}"
|
||||||
|
|
||||||
@property
|
@property
|
||||||
|
|
|
@ -71,8 +71,8 @@ async def test_setup_with_defaults(hass: HomeAssistant) -> None:
|
||||||
assert state.name == "Pi-Hole Seen clients"
|
assert state.name == "Pi-Hole Seen clients"
|
||||||
assert state.state == "0"
|
assert state.state == "0"
|
||||||
|
|
||||||
state = hass.states.get("binary_sensor.pi_hole")
|
state = hass.states.get("binary_sensor.pi_hole_status")
|
||||||
assert state.name == "Pi-Hole"
|
assert state.name == "Pi-Hole Status"
|
||||||
assert state.state == "off"
|
assert state.state == "off"
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue