mirror of
https://github.com/aljazceru/addons.git
synced 2025-12-19 14:14:21 +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
|
# Changelog
|
||||||
|
|
||||||
|
## 0.7.0 ##
|
||||||
|
- Updated to latest snips version 0.51.14
|
||||||
|
- Added default assistant for hassio builtin intents
|
||||||
|
|
||||||
## 0.6.5-p1
|
## 0.6.5-p1
|
||||||
- Bugfix wrong path to assistant files
|
- Bugfix wrong path to assistant files
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ FROM $BUILD_FROM
|
|||||||
COPY run.sh /
|
COPY run.sh /
|
||||||
COPY mosquitto.conf /etc/
|
COPY mosquitto.conf /etc/
|
||||||
COPY asoundrc /root/.asoundrc
|
COPY asoundrc /root/.asoundrc
|
||||||
|
COPY assistant.zip /assistant-default.zip
|
||||||
|
|
||||||
RUN chmod a+x /run.sh
|
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": {
|
"build_from": {
|
||||||
"armhf": "snipsdocker/platform:arm-0.6.5",
|
"armhf": "snipsdocker/platform:arm-0.51.14",
|
||||||
"amd64": "snipsdocker/platform:x86-0.6.5"
|
"amd64": "snipsdocker/platform:x86-0.51.14"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "Snips.AI",
|
"name": "Snips.AI",
|
||||||
"version": "0.6.5-p1",
|
"version": "0.7",
|
||||||
"slug": "snips",
|
"slug": "snips",
|
||||||
"description": "Local voice control platform",
|
"description": "Local voice control platform",
|
||||||
"url": "https://home-assistant.io/addons/snips/",
|
"url": "https://home-assistant.io/addons/snips/",
|
||||||
@@ -11,17 +11,17 @@
|
|||||||
"1883/tcp": 9898
|
"1883/tcp": 9898
|
||||||
},
|
},
|
||||||
"map": ["share"],
|
"map": ["share"],
|
||||||
"devices": ["/dev/snd:/dev/snd:rwm"],
|
"audio": true,
|
||||||
"options": {
|
"options": {
|
||||||
"mqtt_bridge": {
|
"mqtt_bridge": {
|
||||||
"active": false,
|
"active": true,
|
||||||
"host": "172.17.0.1",
|
"host": "core-mosquitto",
|
||||||
"port": 1883,
|
"port": 1883,
|
||||||
"user": "",
|
"user": "",
|
||||||
"password": ""
|
"password": ""
|
||||||
},
|
},
|
||||||
"mic": "0,0",
|
"mic": "1,0",
|
||||||
"speaker": "1,0",
|
"speaker": "0,0",
|
||||||
"assistant": "assistant.zip"
|
"assistant": "assistant.zip"
|
||||||
},
|
},
|
||||||
"schema": {
|
"schema": {
|
||||||
|
|||||||
55
snips/run.sh
55
snips/run.sh
@@ -2,19 +2,36 @@
|
|||||||
set -e
|
set -e
|
||||||
|
|
||||||
CONFIG_PATH=/data/options.json
|
CONFIG_PATH=/data/options.json
|
||||||
SNIPS_CONFIG=/data/config
|
|
||||||
|
|
||||||
MQTT_BRIDGE=$(jq --raw-output '.mqtt_bridge.active' $CONFIG_PATH)
|
MQTT_BRIDGE=$(jq --raw-output '.mqtt_bridge.active' $CONFIG_PATH)
|
||||||
ASSISTANT=$(jq --raw-output '.assistant' $CONFIG_PATH)
|
ASSISTANT=$(jq --raw-output '.assistant' $CONFIG_PATH)
|
||||||
SPEAKER=$(jq --raw-output '.speaker' $CONFIG_PATH)
|
SPEAKER=$(jq --raw-output '.speaker' $CONFIG_PATH)
|
||||||
MIC=$(jq --raw-output '.mic' $CONFIG_PATH)
|
MIC=$(jq --raw-output '.mic' $CONFIG_PATH)
|
||||||
|
|
||||||
echo "[Info] Show audio device"
|
echo "[INFO] Show audio output device"
|
||||||
aplay -l
|
aplay -l
|
||||||
|
|
||||||
echo "[Info] Setup audio device"
|
echo "[INFO] Show audio input device"
|
||||||
sed -i "s/%%SPEAKER%%/$SPEAKER/g" /root/.asoundrc
|
arecord -l
|
||||||
sed -i "s/%%MIC%%/$MIC/g" /root/.asoundrc
|
|
||||||
|
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
|
# mqtt bridge
|
||||||
if [ "$MQTT_BRIDGE" == "true" ]; then
|
if [ "$MQTT_BRIDGE" == "true" ]; then
|
||||||
@@ -23,7 +40,7 @@ if [ "$MQTT_BRIDGE" == "true" ]; then
|
|||||||
USER=$(jq --raw-output '.mqtt_bridge.user' $CONFIG_PATH)
|
USER=$(jq --raw-output '.mqtt_bridge.user' $CONFIG_PATH)
|
||||||
PASSWORD=$(jq --raw-output '.mqtt_bridge.password' $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"
|
echo "connection main-mqtt"
|
||||||
@@ -38,22 +55,32 @@ if [ "$MQTT_BRIDGE" == "true" ]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
{
|
{
|
||||||
echo "topic # OUT"
|
echo "topic hermes/intent/# out"
|
||||||
echo "topic # IN hermes/ hermes/"
|
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
|
} >> /etc/mosquitto.conf
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "[Info] Start internal mqtt broaker"
|
echo "[INFO] Start internal mqtt broker"
|
||||||
mosquitto -c /etc/mosquitto.conf &
|
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
|
# check if a new assistant file exists
|
||||||
if [ -f "/share/$ASSISTANT" ]; then
|
if [ -f "/share/$ASSISTANT" ]; then
|
||||||
echo "[Info] Install/Update snips assistant"
|
echo "[INFO] Install/Update snips assistant"
|
||||||
unzip -o -u "/share/$ASSISTANT" -d "$SNIPS_CONFIG"
|
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
|
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
|
/opt/snips/snips-entrypoint.sh --mqtt localhost:1883
|
||||||
|
|||||||
Reference in New Issue
Block a user