Fix gpio mapping on amd64 systems (#634)

This commit is contained in:
Pascal Vizeli 2018-08-09 00:29:20 +02:00 committed by GitHub
parent 124ce0b8b7
commit 9eee8eade6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,6 +1,7 @@
"""Init file for HassIO addon docker object.""" """Init file for HassIO addon docker object."""
import logging import logging
import os import os
from pathlib import Path
import docker import docker
import requests import requests
@ -204,12 +205,12 @@ class DockerAddon(DockerInterface):
# GPIO support # GPIO support
if self.addon.with_gpio: if self.addon.with_gpio:
for gpio_path in ("/sys/class/gpio", "/sys/devices/platform/soc"):
if not Path(gpio_path).exists():
continue
volumes.update({ volumes.update({
"/sys/class/gpio": { gpio_path: {
'bind': "/sys/class/gpio", 'mode': 'rw' 'bind': gpio_path, 'mode': 'rw'
},
"/sys/devices/platform/soc": {
'bind': "/sys/devices/platform/soc", 'mode': 'rw'
}, },
}) })