Add repr for add-ons (#2023)

This commit is contained in:
Pascal Vizeli 2020-09-07 16:11:46 +02:00 committed by GitHub
parent 3a35561d1d
commit 4cb5770ee0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 0 deletions

View File

@ -87,6 +87,10 @@ class Addon(AddonModel):
self.instance: DockerAddon = DockerAddon(coresys, self)
self.state: AddonState = AddonState.UNKNOWN
def __repr__(self) -> str:
"""Return internal representation."""
return f"<Addon: {self.slug}>"
@property
def in_progress(self) -> bool:
"""Return True if a task is in progress."""

View File

@ -9,6 +9,10 @@ _LOGGER: logging.Logger = logging.getLogger(__name__)
class AddonStore(AddonModel):
"""Hold data for add-on inside Supervisor."""
def __repr__(self) -> str:
"""Return internal representation."""
return f"<Store: {self.slug}>"
@property
def data(self) -> Data:
"""Return add-on data/config."""