mirror of
https://github.com/aljazceru/addons.git
synced 2025-12-18 21:54:20 +01:00
Snips update to 0.51.14 (#239)
* updated to latest snips * Updated docker build from args * Update config.json * Update CHANGELOG.md * Update config.json * Update run.sh * Moved assistant fetch to Dockerfile * Corrected Dockerfile * Moved assistant url to build.json * join to new version numbering * Jump back * Update build.json * Update build.json * change order * Update Dockerfile * Update config.json * Added assistant.zip
This commit is contained in:
committed by
Pascal Vizeli
parent
417cc7dda2
commit
f22b2f5709
@@ -1,4 +1,8 @@
|
||||
# Changelog
|
||||
|
||||
## 0.7.0 ##
|
||||
- Updated to latest snips version 0.51.14
|
||||
- Added default assistant for hassio builtin intents
|
||||
|
||||
## 0.6.5-p1
|
||||
- Bugfix wrong path to assistant files
|
||||
|
||||
@@ -5,6 +5,7 @@ FROM $BUILD_FROM
|
||||
COPY run.sh /
|
||||
COPY mosquitto.conf /etc/
|
||||
COPY asoundrc /root/.asoundrc
|
||||
COPY assistant.zip /assistant-default.zip
|
||||
|
||||
RUN chmod a+x /run.sh
|
||||
|
||||
|
||||
BIN
snips/assistant.zip
Normal file
BIN
snips/assistant.zip
Normal file
Binary file not shown.
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"build_from": {
|
||||
"armhf": "snipsdocker/platform:arm-0.6.5",
|
||||
"amd64": "snipsdocker/platform:x86-0.6.5"
|
||||
"armhf": "snipsdocker/platform:arm-0.51.14",
|
||||
"amd64": "snipsdocker/platform:x86-0.51.14"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "Snips.AI",
|
||||
"version": "0.6.5-p1",
|
||||
"version": "0.7",
|
||||
"slug": "snips",
|
||||
"description": "Local voice control platform",
|
||||
"url": "https://home-assistant.io/addons/snips/",
|
||||
@@ -11,17 +11,17 @@
|
||||
"1883/tcp": 9898
|
||||
},
|
||||
"map": ["share"],
|
||||
"devices": ["/dev/snd:/dev/snd:rwm"],
|
||||
"audio": true,
|
||||
"options": {
|
||||
"mqtt_bridge": {
|
||||
"active": false,
|
||||
"host": "172.17.0.1",
|
||||
"active": true,
|
||||
"host": "core-mosquitto",
|
||||
"port": 1883,
|
||||
"user": "",
|
||||
"password": ""
|
||||
},
|
||||
"mic": "0,0",
|
||||
"speaker": "1,0",
|
||||
"mic": "1,0",
|
||||
"speaker": "0,0",
|
||||
"assistant": "assistant.zip"
|
||||
},
|
||||
"schema": {
|
||||
|
||||
57
snips/run.sh
57
snips/run.sh
@@ -2,19 +2,36 @@
|
||||
set -e
|
||||
|
||||
CONFIG_PATH=/data/options.json
|
||||
SNIPS_CONFIG=/data/config
|
||||
|
||||
MQTT_BRIDGE=$(jq --raw-output '.mqtt_bridge.active' $CONFIG_PATH)
|
||||
ASSISTANT=$(jq --raw-output '.assistant' $CONFIG_PATH)
|
||||
SPEAKER=$(jq --raw-output '.speaker' $CONFIG_PATH)
|
||||
MIC=$(jq --raw-output '.mic' $CONFIG_PATH)
|
||||
|
||||
echo "[Info] Show audio device"
|
||||
echo "[INFO] Show audio output device"
|
||||
aplay -l
|
||||
|
||||
echo "[Info] Setup audio device"
|
||||
sed -i "s/%%SPEAKER%%/$SPEAKER/g" /root/.asoundrc
|
||||
sed -i "s/%%MIC%%/$MIC/g" /root/.asoundrc
|
||||
echo "[INFO] Show audio input device"
|
||||
arecord -l
|
||||
|
||||
echo "[INFO] Setup audio device"
|
||||
if [ -f "/share/asoundrc" ]; then
|
||||
echo "[INFO] Installing /share/asoundrc"
|
||||
cp -v /share/asoundrc /root/.asoundrc
|
||||
else
|
||||
echo "[INFO] Using default asound.conf"
|
||||
sed -i "s/%%SPEAKER%%/$SPEAKER/g" /root/.asoundrc
|
||||
sed -i "s/%%MIC%%/$MIC/g" /root/.asoundrc
|
||||
fi
|
||||
|
||||
echo "[DEBUG] Using /root/.asoundrc"
|
||||
cat /root/.asoundrc
|
||||
|
||||
echo "[INFO] Checking for /share/snips.toml"
|
||||
if [ -f "/share/snips.toml" ]; then
|
||||
echo "[INFO] Installing /share/snips.toml"
|
||||
cp -v /share/snips.toml /etc/
|
||||
fi
|
||||
|
||||
# mqtt bridge
|
||||
if [ "$MQTT_BRIDGE" == "true" ]; then
|
||||
@@ -23,7 +40,7 @@ if [ "$MQTT_BRIDGE" == "true" ]; then
|
||||
USER=$(jq --raw-output '.mqtt_bridge.user' $CONFIG_PATH)
|
||||
PASSWORD=$(jq --raw-output '.mqtt_bridge.password' $CONFIG_PATH)
|
||||
|
||||
echo "[Info] Setup internal mqtt bridge"
|
||||
echo "[INFO] Setup internal mqtt bridge"
|
||||
|
||||
{
|
||||
echo "connection main-mqtt"
|
||||
@@ -36,24 +53,34 @@ if [ "$MQTT_BRIDGE" == "true" ]; then
|
||||
echo "password $PASSWORD"
|
||||
} >> /etc/mosquitto.conf
|
||||
fi
|
||||
|
||||
|
||||
{
|
||||
echo "topic # OUT"
|
||||
echo "topic # IN hermes/ hermes/"
|
||||
echo "topic hermes/intent/# out"
|
||||
echo "topic hermes/hotword/toggleOn out"
|
||||
echo "topic hermes/hotword/toggleOff out"
|
||||
echo "topic hermes/asr/stopListening out"
|
||||
echo "topic hermes/asr/startListening out"
|
||||
echo "topic hermes/nlu/intentNotParsed out"
|
||||
echo "topic # IN hermes/"
|
||||
} >> /etc/mosquitto.conf
|
||||
fi
|
||||
|
||||
echo "[Info] Start internal mqtt broaker"
|
||||
echo "[INFO] Start internal mqtt broker"
|
||||
mosquitto -c /etc/mosquitto.conf &
|
||||
|
||||
# init snips config
|
||||
mkdir -p "$SNIPS_CONFIG"
|
||||
|
||||
echo "[INFO] Checking for updated $ASSISTANT in /share"
|
||||
# check if a new assistant file exists
|
||||
if [ -f "/share/$ASSISTANT" ]; then
|
||||
echo "[Info] Install/Update snips assistant"
|
||||
unzip -o -u "/share/$ASSISTANT" -d "$SNIPS_CONFIG"
|
||||
echo "[INFO] Install/Update snips assistant"
|
||||
unzip -o -u "/share/$ASSISTANT" -d /usr/share/snips
|
||||
# otherwise use the default
|
||||
elif [ -f "/assistant-default.zip" ]; then
|
||||
echo "[INFO] Using default snips assistant"
|
||||
unzip -o -u "/assistant-default.zip" -d /usr/share/snips
|
||||
fi
|
||||
ln -s "$SNIPS_CONFIG/assistant/" /usr/share/snips/assistant
|
||||
|
||||
echo "[INFO] Starting snips-watch"
|
||||
( sleep 2; /usr/bin/snips-watch -vvv --no_color ) &
|
||||
|
||||
/opt/snips/snips-entrypoint.sh --mqtt localhost:1883
|
||||
|
||||
Reference in New Issue
Block a user