mirror of
https://github.com/home-assistant/supervisor.git
synced 2025-07-24 09:36:31 +00:00
Replace abstractproperty with abstractmethod (#3049)
This commit is contained in:
parent
9497f85db9
commit
e7b5864c03
@ -1,5 +1,5 @@
|
||||
"""Supervisor plugins base class."""
|
||||
from abc import ABC, abstractmethod, abstractproperty
|
||||
from abc import ABC, abstractmethod
|
||||
from typing import Optional
|
||||
|
||||
from awesomeversion import AwesomeVersion, AwesomeVersionException
|
||||
@ -37,7 +37,7 @@ class PluginBase(ABC, FileConfiguration, CoreSysAttributes):
|
||||
self._data[ATTR_IMAGE] = value
|
||||
|
||||
@property
|
||||
@abstractproperty
|
||||
@abstractmethod
|
||||
def latest_version(self) -> Optional[AwesomeVersion]:
|
||||
"""Return latest version of the plugin."""
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
"""Baseclass for system checks."""
|
||||
from abc import ABC, abstractmethod, abstractproperty
|
||||
from abc import ABC, abstractmethod
|
||||
import logging
|
||||
from typing import List, Optional
|
||||
|
||||
@ -60,12 +60,12 @@ class CheckBase(ABC, CoreSysAttributes):
|
||||
"""Approve check if it is affected by issue."""
|
||||
|
||||
@property
|
||||
@abstractproperty
|
||||
@abstractmethod
|
||||
def issue(self) -> IssueType:
|
||||
"""Return a IssueType enum."""
|
||||
|
||||
@property
|
||||
@abstractproperty
|
||||
@abstractmethod
|
||||
def context(self) -> ContextType:
|
||||
"""Return a ContextType enum."""
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
"""Baseclass for system evaluations."""
|
||||
from abc import ABC, abstractmethod, abstractproperty
|
||||
from abc import ABC, abstractmethod
|
||||
import logging
|
||||
from typing import List
|
||||
|
||||
@ -39,7 +39,7 @@ class EvaluateBase(ABC, CoreSysAttributes):
|
||||
"""Run evaluation."""
|
||||
|
||||
@property
|
||||
@abstractproperty
|
||||
@abstractmethod
|
||||
def reason(self) -> UnsupportedReason:
|
||||
"""Return a UnsupportedReason enum."""
|
||||
|
||||
@ -49,7 +49,7 @@ class EvaluateBase(ABC, CoreSysAttributes):
|
||||
return self.__class__.__module__.rsplit(".", maxsplit=1)[-1]
|
||||
|
||||
@property
|
||||
@abstractproperty
|
||||
@abstractmethod
|
||||
def on_failure(self) -> str:
|
||||
"""Return a string that is printed when self.evaluate is False."""
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
"""Baseclass for system fixup."""
|
||||
from abc import ABC, abstractmethod, abstractproperty
|
||||
from abc import ABC, abstractmethod
|
||||
import logging
|
||||
from typing import List, Optional
|
||||
|
||||
@ -53,12 +53,12 @@ class FixupBase(ABC, CoreSysAttributes):
|
||||
"""Run processing of fixup."""
|
||||
|
||||
@property
|
||||
@abstractproperty
|
||||
@abstractmethod
|
||||
def suggestion(self) -> SuggestionType:
|
||||
"""Return a SuggestionType enum."""
|
||||
|
||||
@property
|
||||
@abstractproperty
|
||||
@abstractmethod
|
||||
def context(self) -> ContextType:
|
||||
"""Return a ContextType enum."""
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user