Fix ingress_url with not installed add-ons (#998)

Fix ingress_url with not installed add-ons
This commit is contained in:
Pascal Vizeli 2019-04-06 11:24:04 +02:00 committed by GitHub
parent f10b433e1f
commit c2d705a42a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 5 deletions

6
API.md
View File

@ -471,7 +471,7 @@ Get all available addons.
"available": "bool",
"arch": ["armhf", "aarch64", "i386", "amd64"],
"machine": "[raspberrypi2, tinker]",
"homeassistant": "min Home Assistant version",
"homeassistant": "null|min Home Assistant version",
"repository": "12345678|null",
"version": "null|VERSION_INSTALLED",
"last_version": "LAST_VERSION",
@ -511,8 +511,8 @@ Get all available addons.
"discovery": "['service']",
"ip_address": "ip address",
"ingress": "bool",
"ingress_entry": "/api/hassio_ingress/slug",
"ingress_url": "/api/hassio_ingress/slug/entry.html"
"ingress_entry": "null|/api/hassio_ingress/slug",
"ingress_url": "null|/api/hassio_ingress/slug/entry.html"
}
```

View File

@ -391,8 +391,7 @@ class Addon(CoreSysAttributes):
@property
def ingress_url(self):
"""Return URL to ingress url."""
# Use ingress
if not self.with_ingress:
if not self.is_installed or not self.with_ingress:
return None
webui = f"/api/hassio_ingress/{self.ingress_token}/"