mirror of
https://github.com/home-assistant/supervisor.git
synced 2025-07-24 09:36:31 +00:00
Allow Core access to dbus for bluetooth (#1883)
This commit is contained in:
parent
7deed55c2d
commit
19ca485c28
@ -19,6 +19,7 @@ from .const import (
|
||||
ENV_SUPERVISOR_MACHINE,
|
||||
ENV_SUPERVISOR_NAME,
|
||||
ENV_SUPERVISOR_SHARE,
|
||||
MACHINE_ID,
|
||||
SOCKET_DOCKER,
|
||||
SUPERVISOR_VERSION,
|
||||
CoreStates,
|
||||
@ -48,9 +49,6 @@ from .utils.dt import fetch_timezone
|
||||
_LOGGER: logging.Logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
MACHINE_ID = Path("/etc/machine-id")
|
||||
|
||||
|
||||
async def initialize_coresys() -> CoreSys:
|
||||
"""Initialize supervisor coresys/objects."""
|
||||
coresys = CoreSys()
|
||||
|
@ -30,6 +30,7 @@ FILE_HASSIO_AUDIO = Path(SUPERVISOR_DATA, "audio.json")
|
||||
FILE_HASSIO_CLI = Path(SUPERVISOR_DATA, "cli.json")
|
||||
FILE_HASSIO_MULTICAST = Path(SUPERVISOR_DATA, "multicast.json")
|
||||
|
||||
MACHINE_ID = Path("/etc/machine-id")
|
||||
SOCKET_DOCKER = Path("/run/docker.sock")
|
||||
|
||||
DOCKER_NETWORK = "hassio"
|
||||
|
@ -4,7 +4,7 @@ import logging
|
||||
from pathlib import Path
|
||||
from typing import Dict
|
||||
|
||||
from ..const import ENV_TIME
|
||||
from ..const import ENV_TIME, MACHINE_ID
|
||||
from ..coresys import CoreSysAttributes
|
||||
from ..exceptions import DockerAPIError
|
||||
from .interface import DockerInterface
|
||||
@ -35,6 +35,10 @@ class DockerAudio(DockerInterface, CoreSysAttributes):
|
||||
"/run/dbus": {"bind": "/run/dbus", "mode": "ro"},
|
||||
}
|
||||
|
||||
# Machine ID
|
||||
if MACHINE_ID.exists():
|
||||
volumes.update({str(MACHINE_ID): {"bind": str(MACHINE_ID), "mode": "ro"}})
|
||||
|
||||
# SND support
|
||||
if Path("/dev/snd").exists():
|
||||
volumes.update({"/dev/snd": {"bind": "/dev/snd", "mode": "rw"}})
|
||||
|
@ -6,7 +6,7 @@ from typing import Awaitable, Dict, Optional
|
||||
|
||||
import docker
|
||||
|
||||
from ..const import ENV_TIME, ENV_TOKEN, ENV_TOKEN_OLD, LABEL_MACHINE
|
||||
from ..const import ENV_TIME, ENV_TOKEN, ENV_TOKEN_OLD, LABEL_MACHINE, MACHINE_ID
|
||||
from ..exceptions import DockerAPIError
|
||||
from .interface import CommandReturn, DockerInterface
|
||||
|
||||
@ -48,7 +48,7 @@ class DockerHomeAssistant(DockerInterface):
|
||||
@property
|
||||
def volumes(self) -> Dict[str, Dict[str, str]]:
|
||||
"""Return Volumes for the mount."""
|
||||
volumes = {}
|
||||
volumes = {"/run/dbus": {"bind": "/run/dbus", "mode": "ro"}}
|
||||
|
||||
# Add folders
|
||||
volumes.update(
|
||||
@ -65,6 +65,10 @@ class DockerHomeAssistant(DockerInterface):
|
||||
}
|
||||
)
|
||||
|
||||
# Machine ID
|
||||
if MACHINE_ID.exists():
|
||||
volumes.update({str(MACHINE_ID): {"bind": str(MACHINE_ID), "mode": "ro"}})
|
||||
|
||||
# Configuration Audio
|
||||
volumes.update(
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user