Fix machine version (#1167)

This commit is contained in:
Pascal Vizeli 2019-07-19 11:47:55 +02:00 committed by GitHub
parent 3af4e14e83
commit 03c5596e04
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 4 deletions

View File

@ -59,7 +59,7 @@ from ..const import (
SECURITY_PROFILE,
)
from ..coresys import CoreSysAttributes
from .validate import MACHINE_ALL, RE_SERVICE, RE_VOLUME, validate_options
from .validate import RE_SERVICE, RE_VOLUME, validate_options
Data = Dict[str, Any]
@ -391,7 +391,7 @@ class AddonModel(CoreSysAttributes):
@property
def supported_machine(self) -> List[str]:
"""Return list of supported machine."""
return self.data.get(ATTR_MACHINE, MACHINE_ALL)
return self.data.get(ATTR_MACHINE, [])
@property
def image(self) -> str:
@ -460,8 +460,8 @@ class AddonModel(CoreSysAttributes):
return False
# Machine / Hardware
machine = config.get(ATTR_MACHINE) or MACHINE_ALL
if self.sys_machine not in machine:
machine = config.get(ATTR_MACHINE)
if machine and self.sys_machine not in machine:
return False
# Home Assistant

View File

@ -139,6 +139,8 @@ MACHINE_ALL = [
"raspberrypi2",
"raspberrypi3",
"raspberrypi3-64",
"raspberrypi4",
"raspberrypi4-64",
"tinker",
]