Update Google Assistant (#287)

* Delete asoundrc

* Update config.json

* Update run.sh

* Create CHANGELOG.md

* Update config.json

* Update config.json

* Update run.sh

* Update CHANGELOG.md

* Update build.json

* Update CHANGELOG.md

* Update Dockerfile

* Update build.json

* Update build.json

* Update build.json

* Update build.json
This commit is contained in:
Pascal Vizeli
2018-05-07 14:29:10 +02:00
committed by GitHub
parent 2b0e7e53ff
commit 6f7e48ed5f
6 changed files with 11 additions and 35 deletions

View File

@@ -0,0 +1,7 @@
# Changelog
## 1.0
- Update Google Assistant SDK 0.4.4
- Update Google Assistant Library 0.1.1
- Use new Hass.io Audio System
- Use now a ubuntu based image

View File

@@ -13,7 +13,6 @@ RUN apt-get update \
# Copy data # Copy data
COPY run.sh / COPY run.sh /
COPY *.py / COPY *.py /
COPY asoundrc /root/.asoundrc
RUN chmod a+x /run.sh RUN chmod a+x /run.sh

View File

@@ -1,17 +0,0 @@
pcm.!default {
type asym
capture.pcm "mic"
playback.pcm "speaker"
}
pcm.mic {
type plug
slave {
pcm "hw:%%MIC%%"
}
}
pcm.speaker {
type plug
slave {
pcm "hw:%%SPEAKER%%"
}
}

View File

@@ -1,6 +1,6 @@
{ {
"build_from": { "build_from": {
"armhf": "multiarch/debian-debootstrap:armhf-stretch", "armhf": "multiarch/ubuntu-core:armhf-xenial",
"amd64": "multiarch/debian-debootstrap:amd64-stretch" "amd64": "multiarch/ubuntu-core:amd64-xenial"
} }
} }

View File

@@ -1,6 +1,6 @@
{ {
"name": "Google Assistant", "name": "Google Assistant",
"version": "0.0.3-p5", "version": "1.0",
"slug": "google_assistant", "slug": "google_assistant",
"description": "A virtual personal assistant developed by Google", "description": "A virtual personal assistant developed by Google",
"url": "https://home-assistant.io/addons/google_assistant/", "url": "https://home-assistant.io/addons/google_assistant/",
@@ -8,19 +8,15 @@
"boot": "auto", "boot": "auto",
"arch": ["armhf", "amd64"], "arch": ["armhf", "amd64"],
"map": ["share"], "map": ["share"],
"devices": ["/dev/snd:/dev/snd:rwm"], "audio": true,
"ports": { "ports": {
"9324/tcp": 9324 "9324/tcp": 9324
}, },
"webui": "http://[HOST]:[PORT:9324]", "webui": "http://[HOST]:[PORT:9324]",
"options": { "options": {
"mic": "0,0",
"speaker": "1,0",
"client_secrets": "google_assistant.json" "client_secrets": "google_assistant.json"
}, },
"schema": { "schema": {
"mic": "str",
"speaker": "str",
"client_secrets": "str" "client_secrets": "str"
}, },
"image": "homeassistant/{arch}-addon-google_assistant" "image": "homeassistant/{arch}-addon-google_assistant"

View File

@@ -6,15 +6,6 @@ CLIENT_JSON=/data/client.json
CRED_JSON=/data/cred.json CRED_JSON=/data/cred.json
CLIENT_SECRETS=$(jq --raw-output '.client_secrets' $CONFIG_PATH) CLIENT_SECRETS=$(jq --raw-output '.client_secrets' $CONFIG_PATH)
SPEAKER=$(jq --raw-output '.speaker' $CONFIG_PATH)
MIC=$(jq --raw-output '.mic' $CONFIG_PATH)
echo "[Info] Show audio device"
aplay -l
echo "[Info] Setup audio device"
sed -i "s/%%SPEAKER%%/$SPEAKER/g" /root/.asoundrc
sed -i "s/%%MIC%%/$MIC/g" /root/.asoundrc
# check if a new assistant file exists # check if a new assistant file exists
if [ -f "/share/$CLIENT_SECRETS" ]; then if [ -f "/share/$CLIENT_SECRETS" ]; then