Fix device bug (#1078)

This commit is contained in:
Pascal Vizeli 2019-05-09 11:41:37 +02:00 committed by GitHub
parent dc4f38ebd0
commit b2c3157361
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 2 deletions

View File

@ -257,7 +257,7 @@ class AddonModel(CoreSysAttributes):
@property
def devices(self) -> Optional[List[str]]:
"""Return devices of add-on."""
return self.data.get(ATTR_DEVICES)
return self.data.get(ATTR_DEVICES, [])
@property
def auto_uart(self) -> bool:

View File

@ -126,7 +126,11 @@ class DockerAddon(DockerInterface):
@property
def devices(self) -> List[str]:
"""Return needed devices."""
devices = self.addon.devices or []
devices = []
# Extend add-on config
if self.addon.devices:
devices.extend(self.addon.devices)
# Use audio devices
if self.addon.with_audio and self.sys_hardware.support_audio: