Make addon model abstract
"""Init file for Supervisor add-ons."""
+from abc import ABC, abstractmethod
from pathlib import Path
from typing import Any, Awaitable, Dict, List, Optional
@@ -72,7 +73,7 @@ from .validate import RE_SERVICE, RE_VOLUME, schema_ui_options, validate_options
Data = Dict[str, Any]
-class AddonModel(CoreSysAttributes):
+class AddonModel(CoreSysAttributes, ABC):
"""Add-on Data layout."""
def __init__(self, coresys: CoreSys, slug: str):
@@ -81,19 +82,19 @@ class AddonModel(CoreSysAttributes):
self.slug: str = slug
@property
+ @abstractmethod
def data(self) -> Data:
- """Return Add-on config/data."""
- raise NotImplementedError()
+ """Return add-on config/data."""
@property
+ @abstractmethod
def is_installed(self) -> bool:
"""Return True if an add-on is installed."""
- raise NotImplementedError()
@property
+ @abstractmethod
def is_detached(self) -> bool:
"""Return True if add-on is detached."""
- raise NotImplementedError()
@property
def available(self) -> bool:
