Add configuration url to Sonarr (#58085)

pull/58134/head
Jesse Hills 2021-10-21 07:25:29 +13:00 committed by GitHub
parent 70fc3f84fc
commit 35e9cf68a2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 0 deletions

View File

@ -35,10 +35,15 @@ class SonarrEntity(Entity):
if self._device_id is None:
return None
configuration_url = "https://" if self.sonarr.tls else "http://"
configuration_url += f"{self.sonarr.host}:{self.sonarr.port}"
configuration_url += self.sonarr.base_path.replace("/api", "")
return {
ATTR_IDENTIFIERS: {(DOMAIN, self._device_id)},
ATTR_NAME: "Activity Sensor",
ATTR_MANUFACTURER: "Sonarr",
ATTR_SW_VERSION: self.sonarr.app.info.version,
"entry_type": "service",
"configuration_url": configuration_url,
}