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."""
import logging
import os
from pathlib import Path
import docker
import requests
@ -204,12 +205,12 @@ class DockerAddon(DockerInterface):
# GPIO support
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({
"/sys/class/gpio": {
'bind': "/sys/class/gpio", 'mode': 'rw'
},
"/sys/devices/platform/soc": {
'bind': "/sys/devices/platform/soc", 'mode': 'rw'
gpio_path: {
'bind': gpio_path, 'mode': 'rw'
},
})