From 148d2480ac173120218db8ab32eb92eb00a8a3b8 Mon Sep 17 00:00:00 2001 From: Michael <35783820+mib1185@users.noreply.github.com> Date: Fri, 15 Oct 2021 04:32:24 +0200 Subject: [PATCH] Add configuration url to Pi hole (#57718) --- homeassistant/components/pi_hole/__init__.py | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/homeassistant/components/pi_hole/__init__.py b/homeassistant/components/pi_hole/__init__.py index 5c679a4839a..5e960a1f70d 100644 --- a/homeassistant/components/pi_hole/__init__.py +++ b/homeassistant/components/pi_hole/__init__.py @@ -177,8 +177,14 @@ class PiHoleEntity(CoordinatorEntity): @property def device_info(self) -> DeviceInfo: """Return the device information of the entity.""" - return { - "identifiers": {(DOMAIN, self._server_unique_id)}, - "name": self._name, - "manufacturer": "Pi-hole", - } + if self.api.tls: + config_url = f"https://{self.api.host}/{self.api.location}" + else: + config_url = f"http://{self.api.host}/{self.api.location}" + + return DeviceInfo( + identifiers={(DOMAIN, self._server_unique_id)}, + name=self._name, + manufacturer="Pi-hole", + configuration_url=config_url, + )