mirror of
https://github.com/home-assistant/supervisor.git
synced 2025-12-23 16:29:46 +00:00
* Deprecate i386, armhf and armv7 Supervisor architectures * Exclude Core from architecture deprecation checks This allows to download the latest available Core version still, even on deprecated systems. * Fix pytest
39 lines
1.2 KiB
Python
39 lines
1.2 KiB
Python
"""Evaluation class for system architecture support."""
|
|
|
|
from ...const import CoreState
|
|
from ...coresys import CoreSys
|
|
from ..const import UnsupportedReason
|
|
from .base import EvaluateBase
|
|
|
|
|
|
def setup(coresys: CoreSys) -> EvaluateBase:
|
|
"""Initialize evaluation-setup function."""
|
|
return EvaluateSystemArchitecture(coresys)
|
|
|
|
|
|
class EvaluateSystemArchitecture(EvaluateBase):
|
|
"""Evaluate if the current Supervisor architecture is supported."""
|
|
|
|
@property
|
|
def reason(self) -> UnsupportedReason:
|
|
"""Return a UnsupportedReason enum."""
|
|
return UnsupportedReason.SYSTEM_ARCHITECTURE
|
|
|
|
@property
|
|
def on_failure(self) -> str:
|
|
"""Return a string that is printed when self.evaluate is True."""
|
|
return "System architecture is no longer supported. Move to a supported system architecture."
|
|
|
|
@property
|
|
def states(self) -> list[CoreState]:
|
|
"""Return a list of valid states when this evaluation can run."""
|
|
return [CoreState.INITIALIZE]
|
|
|
|
async def evaluate(self):
|
|
"""Run evaluation."""
|
|
return self.sys_host.info.sys_arch.supervisor in {
|
|
"i386",
|
|
"armhf",
|
|
"armv7",
|
|
}
|