Skip to content

Commit

Permalink
Add support for new audo layer (home-assistant#1153)
Browse files Browse the repository at this point in the history
* Add support for new audo layer

* Add layer

* restucture

* better struct

* Improve devcontainer

* Fix container

* Fix LN

* disable lint

* ignore
  • Loading branch information
pvizeli authored Mar 1, 2020
1 parent 9f04efe commit c853fce
Show file tree
Hide file tree
Showing 30 changed files with 238 additions and 187 deletions.
31 changes: 21 additions & 10 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM ubuntu:18.04
FROM debian

WORKDIR /workspaces

Expand All @@ -15,19 +15,30 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
apt-transport-https \
ca-certificates \
curl \
dbus \
software-properties-common \
gpg-agent \
git \
jq \
sudo \
&& curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add - \
&& add-apt-repository "deb https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" \
gnupg \
&& curl -fsSL https://download.docker.com/linux/debian/gpg | apt-key add - \
&& add-apt-repository "deb https://download.docker.com/linux/debian $(lsb_release -cs) stable" \
&& apt-get update && apt-get install -y --no-install-recommends \
docker-ce \
docker-ce-cli \
containerd.io
# This is a development container. Don't bother to clean up apt cache, this way we have it handy later
containerd.io \
&& rm -rf /var/lib/apt/lists/*

# Install tools
ARG SHELLCHECK_VERSION=0.7.0
RUN apt-get update && apt-get install -y --no-install-recommends \
jq \
dbus \
network-manager \
libpulse0 \
git \
tar \
&& rm -rf /var/lib/apt/lists/* \
\
&& curl -SL "https://storage.googleapis.com/shellcheck/shellcheck-v${SHELLCHECK_VERSION}.linux.x86_64.tar.xz" | tar xzf - \
&& cp "shellcheck-v${SHELLCHECK_VERSION}/shellcheck" /usr/bin/ \
&& rm -rf shellcheck-v${SHELLCHECK_VERSION}

# Generate a machine-id for this container
RUN rm /etc/machine-id && dbus-uuidgen --ensure=/etc/machine-id
Expand Down
6 changes: 5 additions & 1 deletion .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Based on https://github.com/issacg/hassio-addon-devcontainer
{
"name": "Hass.io Community Add-Ons",
"name": "Home Assistant Add-Ons",
"context": "..",
"dockerFile": "Dockerfile",
"appPort": "7123:8123",
Expand All @@ -9,6 +9,10 @@
"GIT_EDITOR=code --wait",
"--privileged"
],
"extensions": [
"timonwong.shellcheck",
"esbenp.prettier-vscode"
],
"settings": {
"terminal.integrated.shell.linux": "/bin/bash"
},
Expand Down
1 change: 1 addition & 0 deletions .shellcheckrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
disable=SC1008
6 changes: 3 additions & 3 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"version": "2.0.0",
"tasks": [
{
"label": "Start Hass.io",
"label": "Start Home Assistant",
"type": "shell",
"command": "/workspaces/test_hassio/addons/local/.devcontainer/start_hassio.sh",
"group": {
Expand All @@ -17,7 +17,7 @@
},
"problemMatcher": []
},{
"label": "Cleanup stale Hass.io environment",
"label": "Cleanup stale Home Assistant environment",
"type": "shell",
"command": "/workspaces/test_hassio/addons/local/.devcontainer/start_hassio.sh --cleanup",
"group": "test",
Expand All @@ -27,7 +27,7 @@
},
"problemMatcher": []
},{
"label": "Run Hass.io CLI",
"label": "Run Home Assistant CLI",
"type": "shell",
"command": "docker run --rm -ti -v /etc/machine-id:/etc/machine-id --network=hassio --add-host hassio:172.30.32.2 homeassistant/amd64-hassio-cli:dev",
"group": "test",
Expand Down
26 changes: 16 additions & 10 deletions ada/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,45 +1,51 @@
# Changelog

## 1.0
## 1.1.0

- Renaming Home Assistant
- Convert to s6-overlay
- Support new audio backend

## 1.0.0

- Support aarch64 in armv7 combat mode

## 0.9
## 0.9.0

- Corrected link to documentation inside the add-on
- Adjust source links in Dockerfile
- Update add-on documentation to match current state

## 0.8
## 0.8.0

- Fix API url for access to Home Assistant

## 0.7
## 0.7.0

- Add missing options

## 0.6
## 0.6.0

- Update Ada to 0.7
- Add options to change TTS / STT Home Assistant provider

## 0.5
## 0.5.0

- Update Ada to 0.6

## 0.4
## 0.4.0

- Update Ada to 0.5

## 0.3
## 0.3.0

- Update Ada to 0.4

## 0.2
## 0.2.0

- Update Ada to 0.3
- Add armhf support

## 0.1
## 0.1.0

- Initial support
5 changes: 2 additions & 3 deletions ada/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ ARG ADA_VERSION
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
portaudio19-dev \
libasound2-plugins \
libsndfile1 \
mplayer \
libffi-dev \
Expand All @@ -32,6 +33,4 @@ RUN apt-get update \
&& rm -rf /var/lib/apt/lists/*

WORKDIR /
COPY data/run.sh /

CMD ["/run.sh"]
COPY rootfs /
5 changes: 3 additions & 2 deletions ada/config.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
{
"name": "Hey Ada!",
"version": "1.0",
"version": "1.1.0",
"slug": "ada",
"description": "Voice assistant powered by Home Assistant",
"url": "https://github.com/home-assistant/hassio-addons/blob/master/ada",
"arch": ["armhf", "armv7", "amd64"],
"init": false,
"startup": "application",
"boot": "auto",
"audio": true,
"homeassistant": "0.102.0.dev",
"homeassistant": "0.102.0",
"homeassistant_api": true,
"options": {
"stt": "cloud",
Expand Down
6 changes: 0 additions & 6 deletions ada/data/run.sh

This file was deleted.

8 changes: 8 additions & 0 deletions ada/rootfs/etc/services.d/ada/finish
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/usr/bin/execlineb -S0
# ==============================================================================
# Take down the S6 supervision tree when Ada fails
# ==============================================================================
if { s6-test ${1} -ne 0 }
if { s6-test ${1} -ne 256 }

s6-svscanctl -t /var/run/s6/services
8 changes: 8 additions & 0 deletions ada/rootfs/etc/services.d/ada/run
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/usr/bin/with-contenv bashio
# ==============================================================================
# Start Ada service
# ==============================================================================
STT=$(bashio::config 'stt')
TTS=$(bashio::config 'tts')

exec python3 -m ada --url "http://supervisor/core/api" --key "$SUPERVISOR_TOKEN" --stt "$STT" --tts "$TTS"
3 changes: 2 additions & 1 deletion azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@ jobs:
- script: |
shopt -s globstar
sudo docker run --rm -i \
-v $(pwd):/mnt:ro koalaman/shellcheck:$(versionShellCheck) **/*.sh
-v $(pwd):/mnt:ro -e SHELLCHECK_OPTS="-e SC1008" \
koalaman/shellcheck:$(versionShellCheck) **/*.sh
displayName: "Run ShellCheck"
- job: "JQ"
Expand Down
61 changes: 33 additions & 28 deletions ssh/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,132 +1,137 @@
# Changelog

## 8.4
## 8.5.0

- Add support for PulseAudio with new Audio backend
- Migrate to s6-overlay

## 8.4.0

- Support to use only web terminal without SSH server

**ATTENTION:** If you want access with SSH, you need maybe add the Port setting option back.

## 8.3
## 8.3.0

- Update Home Assistant CLI to 4.0.1
- Add backward compatibility with the hassio command
- Update Web terminal to ttyd 1.6.0 with Libwebsockets 3.2.2
- Rename HASSIO_TOKEN to SUPERVISOR_TOKEN in shell profile

## 8.2
## 8.2.0

- Fix creation of new tmux terminal windows
- Add add-on icon
- Update welcome logo
- Fix SSH folder issue with authorized keys

## 8.1
## 8.1.0

- Fix for non existing .bash_profile startup error
- Add current, short, path to command line prompt

## 8.0
## 8.0.0

- Add support for a web-based terminal via Ingress
- Upgrade Alpine Linux to 3.11
- Improve Hass.io API token handling
- Persist .ssh folder across restarts
- Add helper symlink folders to user home folder

## 7.1
## 7.1.0

- Update Hass.io CLI to 3.1.1

## 7.0
## 7.0.0

- Added bash_profile as a persistent file

## 6.4
## 6.4.0

- Changed logging from DEBUG -> INFO

## 6.3
## 6.3.0

- Update Hass.io CLI to 3.1.0

## 6.2
## 6.2.0

- Update Hass.io CLI to 3.0.0

## 6.1
## 6.1.0

- Update Hass.io CLI to 2.3.0

## 6.0
## 6.0.0

- Update and pin base image to Alpine 3.10

## 5.6
## 5.6.0

- Fixes crash when using authorized keys

## 5.5
## 5.5.0

- Rewrite add-on onto Bashio
- Added documentation to add-on repository
- Code styling improvements

## 5.4
## 5.4.0

- Update Hass.io CLI to 2.2.0

## 5.3
## 5.3.0

- Fix: User root not allowed because account is locked

## 5.2
## 5.2.0

- Update Hass.io CLI to 2.1.0

## 5.1
## 5.1.0

- Map all serial devices into container for manual adjustments

## 5.0
## 5.0.0

- Update Hass.io CLI to 2.0.1, include bash completion

## 4.0
## 4.0.0

- Update Hass.io CLI to 1.4.0
- Add new API role profile
- Update OpenSSH to 7.7

## 3.7
## 3.7.0

- Add YAML highlighting for nano

## 3.6
## 3.6.0

- Update Hass.io CLI to 1.3.1

## 3.5
## 3.5.0

- Update Hass.io CLI to 1.3.0

## 3.4
## 3.4.0

- Update Hass.io CLI to 1.2.1

## 3.3
## 3.3.0

- Update Hass.io CLI to 1.1.2

## 3.2
## 3.2.0

- Downgrade Hass.io CLI to 1.0.1

## 3.1
## 3.1.0

- Update Hass.io CLI to 1.1.1
- Change internal token handling for Hass.io API

## 3.0
## 3.0.0

- Use new base images
- Add hassio-cli version 1.0
Expand Down
Loading

0 comments on commit c853fce

Please sign in to comment.