Add configuration url to Pi hole (#57718)

This commit is contained in:
Michael 2021-10-15 04:32:24 +02:00 committed by GitHub
parent e232bdc082
commit 148d2480ac
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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,
)