mirror of
https://github.com/aljazceru/addons.git
synced 2025-12-18 21:54:20 +01:00
Migrate google assistant to new audio (#1160)
* Migrate google assistant to new audio * Fix lint * clean old handling stuff
This commit is contained in:
@@ -34,9 +34,10 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
|
||||
libpulse0 \
|
||||
git \
|
||||
tar \
|
||||
xz-utils \
|
||||
&& rm -rf /var/lib/apt/lists/* \
|
||||
\
|
||||
&& curl -SL "https://storage.googleapis.com/shellcheck/shellcheck-v${SHELLCHECK_VERSION}.linux.x86_64.tar.xz" | tar xzf - \
|
||||
&& curl -SL "https://storage.googleapis.com/shellcheck/shellcheck-v${SHELLCHECK_VERSION}.linux.x86_64.tar.xz" | tar xJf - \
|
||||
&& cp "shellcheck-v${SHELLCHECK_VERSION}/shellcheck" /usr/bin/ \
|
||||
&& rm -rf shellcheck-v${SHELLCHECK_VERSION}
|
||||
|
||||
|
||||
@@ -1,42 +1,23 @@
|
||||
# Changelog
|
||||
|
||||
## 2.2
|
||||
## 2.3.0
|
||||
|
||||
- Update Google Assistant SDK 0.5.1
|
||||
- Update Google Assistant Library 1.1.0
|
||||
- Use homeassistant debian base images
|
||||
- Support new audio backend
|
||||
- Migrate to s6-overlay
|
||||
|
||||
## 2.2.0
|
||||
|
||||
- Use homeassistant ubuntu base images
|
||||
|
||||
## 2.1
|
||||
## 2.1.0
|
||||
|
||||
- Add error handling for decoding UTF-8
|
||||
|
||||
## 2.0
|
||||
## 2.0.0
|
||||
|
||||
- Update Google Assistant SDK 0.5.0
|
||||
- Update Google Assistant Library 1.0.0
|
||||
- Revert base images
|
||||
|
||||
## 1.5
|
||||
|
||||
- Change event handling
|
||||
|
||||
## 1.4
|
||||
|
||||
- Fix typo
|
||||
|
||||
## 1.3
|
||||
|
||||
- Add project id with new device register system
|
||||
|
||||
## 1.2
|
||||
|
||||
- Add model id
|
||||
|
||||
## 1.1
|
||||
|
||||
- Bugfix OAuth webinterface
|
||||
|
||||
## 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
|
||||
|
||||
@@ -1,28 +1,34 @@
|
||||
ARG BUILD_FROM
|
||||
FROM $BUILD_FROM
|
||||
|
||||
ARG \
|
||||
GOOGLE_GRPC_VERSION \
|
||||
GOOGLE_LIBRARY_VERSION \
|
||||
GOOGLE_SDK_VERSION \
|
||||
GOOGLE_AUTH_VERSION \
|
||||
REQUESTS_OAUTHLIB_VERSION \
|
||||
CHERRYPY_VERSION
|
||||
|
||||
# Install packages
|
||||
RUN apt-get update \
|
||||
&& apt-get install -y --no-install-recommends \
|
||||
alsa-utils \
|
||||
libportaudio2 \
|
||||
libasound2-plugins \
|
||||
python3 \
|
||||
python3-dev \
|
||||
&& curl --silent --show-error --retry 5 \
|
||||
"https://bootstrap.pypa.io/get-pip.py" \
|
||||
| python3 \
|
||||
&& pip3 install --no-cache-dir \
|
||||
cherrypy==18.1.1 \
|
||||
google-assistant-grpc==0.2.0 \
|
||||
google-assistant-library==1.0.0 \
|
||||
google-assistant-sdk==0.5.0 \
|
||||
google-auth==1.6.3 \
|
||||
requests_oauthlib==1.2.0 \
|
||||
cherrypy=="${CHERRYPY_VERSION}" \
|
||||
google-assistant-grpc=="${GOOGLE_GRPC_VERSION}" \
|
||||
google-assistant-library=="${GOOGLE_LIBRARY_VERSION}" \
|
||||
google-assistant-sdk=="${GOOGLE_SDK_VERSION}" \
|
||||
google-auth=="${GOOGLE_AUTH_VERSION}" \
|
||||
requests_oauthlib=="${REQUESTS_OAUTHLIB_VERSION}" \
|
||||
&& apt-get remove -y --purge python3-dev \
|
||||
&& apt-get clean -y \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
# Copy data
|
||||
COPY data/* /
|
||||
|
||||
ENTRYPOINT [ "/run.sh" ]
|
||||
COPY rootfs /
|
||||
|
||||
@@ -1,6 +1,15 @@
|
||||
{
|
||||
"build_from": {
|
||||
"armv7": "homeassistant/armv7-base-ubuntu:18.04",
|
||||
"amd64": "homeassistant/amd64-base-ubuntu:18.04"
|
||||
"armhf": "homeassistant/armhf-base-debian:buster",
|
||||
"armv7": "homeassistant/armv7-base-debian:buster",
|
||||
"amd64": "homeassistant/amd64-base-debian:buster"
|
||||
},
|
||||
"args": {
|
||||
"GOOGLE_GRPC_VERSION": "0.2.1",
|
||||
"GOOGLE_LIBRARY_VERSION": "1.0.1",
|
||||
"GOOGLE_SDK_VERSION": "0.5.1",
|
||||
"GOOGLE_AUTH_VERSION": "1.11.2",
|
||||
"REQUESTS_OAUTHLIB_VERSION": "1.3.0",
|
||||
"CHERRYPY_VERSION": "18.5.0"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,12 +1,13 @@
|
||||
{
|
||||
"name": "Google Assistant SDK",
|
||||
"version": "2.2",
|
||||
"version": "2.3.0",
|
||||
"slug": "google_assistant",
|
||||
"description": "A virtual personal assistant developed by Google",
|
||||
"url": "https://github.com/home-assistant/hassio-addons/tree/master/google_assistant",
|
||||
"startup": "application",
|
||||
"boot": "auto",
|
||||
"arch": ["armv7", "amd64"],
|
||||
"arch": ["armhf", "armv7", "amd64"],
|
||||
"init": false,
|
||||
"advanced": true,
|
||||
"stage": "experimental",
|
||||
"map": ["share"],
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
#!/usr/bin/execlineb -S0
|
||||
# ==============================================================================
|
||||
# Take down the S6 supervision tree when Google Assistant fails
|
||||
# ==============================================================================
|
||||
if { s6-test ${1} -ne 0 }
|
||||
if { s6-test ${1} -ne 256 }
|
||||
|
||||
s6-svscanctl -t /var/run/s6/services
|
||||
12
google_assistant/data/run.sh → google_assistant/rootfs/etc/services.d/google-assistant/run
Executable file → Normal file
12
google_assistant/data/run.sh → google_assistant/rootfs/etc/services.d/google-assistant/run
Executable file → Normal file
@@ -1,5 +1,7 @@
|
||||
#!/usr/bin/env bashio
|
||||
|
||||
#!/usr/bin/with-contenv bashio
|
||||
# ==============================================================================
|
||||
# Start Google Assistant service
|
||||
# ==============================================================================
|
||||
CLIENT_JSON=/data/client.json
|
||||
CRED_JSON=/data/cred.json
|
||||
|
||||
@@ -16,11 +18,11 @@ fi
|
||||
if ! bashio::fs.file_exists "${CRED_JSON}" && bashio::fs.file_exists "${CLIENT_JSON}";
|
||||
then
|
||||
bashio::log.info "Starting WebUI for handling OAuth2..."
|
||||
python3 /hassio_oauth.py "${CLIENT_JSON}" "${CRED_JSON}"
|
||||
python3 /usr/bin/hassio_oauth.py "${CLIENT_JSON}" "${CRED_JSON}"
|
||||
elif ! bashio::fs.file_exists "${CRED_JSON}"; then
|
||||
bashio::exit.nok "You need initialize Google Assistant with a client secret JSON!"
|
||||
fi
|
||||
|
||||
basio::log.info "Starting Home Assistant GAssisant SDK..."
|
||||
exec python3 /hassio_gassistant.py \
|
||||
"${CRED_JSON}" "${PROJECT_ID}" "${MODEL_ID}" < /dev/null
|
||||
exec python3 /usr/bin/hassio_gassistant.py \
|
||||
"${CRED_JSON}" "${PROJECT_ID}" "${MODEL_ID}"
|
||||
Reference in New Issue
Block a user