1
0
mirror of https://github.com/home-assistant/supervisor.git synced 2025-12-24 20:35:55 +00:00

Adds support for add-on icons (#328)

* Adds support for add-on icons

* Update addons.py
This commit is contained in:
Franck Nijhof
2018-01-25 00:02:15 +01:00
committed by GitHub
parent 7a02777cfb
commit 04f5ee0a80
6 changed files with 33 additions and 3 deletions

View File

@@ -370,6 +370,11 @@ class Addon(CoreSysAttributes):
"""Return url of addon."""
return self._mesh.get(ATTR_URL)
@property
def with_icon(self):
"""Return True if a icon exists."""
return self.path_icon.exists()
@property
def with_logo(self):
"""Return True if a logo exists."""
@@ -434,6 +439,11 @@ class Addon(CoreSysAttributes):
"""Return path to this addon."""
return Path(self._mesh[ATTR_LOCATON])
@property
def path_icon(self):
"""Return path to addon icon."""
return Path(self.path_location, 'icon.png')
@property
def path_logo(self):
"""Return path to addon logo."""