mirror of
https://github.com/aljazceru/addons.git
synced 2025-12-18 21:54:20 +01:00
Update snips 2.0 (#280)
This commit is contained in:
@@ -1,5 +1,9 @@
|
|||||||
# Changelog
|
# Changelog
|
||||||
|
|
||||||
|
## 2.0
|
||||||
|
- Use new Supervisor Audio backend
|
||||||
|
- Update preinstalled assistant for Home-Assistant
|
||||||
|
|
||||||
## 1.0
|
## 1.0
|
||||||
- Updated to latest snips version 0.53.17
|
- Updated to latest snips version 0.53.17
|
||||||
|
|
||||||
|
|||||||
@@ -4,7 +4,6 @@ FROM $BUILD_FROM
|
|||||||
# Copy data
|
# Copy data
|
||||||
COPY run.sh /
|
COPY run.sh /
|
||||||
COPY mosquitto.conf /etc/
|
COPY mosquitto.conf /etc/
|
||||||
COPY asoundrc /root/.asoundrc
|
|
||||||
COPY assistant.zip /assistant-default.zip
|
COPY assistant.zip /assistant-default.zip
|
||||||
|
|
||||||
RUN chmod a+x /run.sh
|
RUN chmod a+x /run.sh
|
||||||
|
|||||||
@@ -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%%"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Binary file not shown.
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "Snips.AI",
|
"name": "Snips.AI",
|
||||||
"version": "1.0",
|
"version": "2.0",
|
||||||
"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/",
|
||||||
@@ -20,8 +20,6 @@
|
|||||||
"user": "",
|
"user": "",
|
||||||
"password": ""
|
"password": ""
|
||||||
},
|
},
|
||||||
"mic": "1,0",
|
|
||||||
"speaker": "0,0",
|
|
||||||
"assistant": "assistant.zip"
|
"assistant": "assistant.zip"
|
||||||
},
|
},
|
||||||
"schema": {
|
"schema": {
|
||||||
@@ -32,8 +30,6 @@
|
|||||||
"user": "str",
|
"user": "str",
|
||||||
"password": "str"
|
"password": "str"
|
||||||
},
|
},
|
||||||
"mic": "str",
|
|
||||||
"speaker": "str",
|
|
||||||
"assistant": "str"
|
"assistant": "str"
|
||||||
},
|
},
|
||||||
"image": "homeassistant/{arch}-addon-snips"
|
"image": "homeassistant/{arch}-addon-snips"
|
||||||
|
|||||||
23
snips/run.sh
23
snips/run.sh
@@ -5,27 +5,6 @@ CONFIG_PATH=/data/options.json
|
|||||||
|
|
||||||
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)
|
|
||||||
MIC=$(jq --raw-output '.mic' $CONFIG_PATH)
|
|
||||||
|
|
||||||
echo "[INFO] Show audio output device"
|
|
||||||
aplay -l
|
|
||||||
|
|
||||||
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"
|
echo "[INFO] Checking for /share/snips.toml"
|
||||||
if [ -f "/share/snips.toml" ]; then
|
if [ -f "/share/snips.toml" ]; then
|
||||||
@@ -74,7 +53,7 @@ echo "[INFO] Checking for updated $ASSISTANT in /share"
|
|||||||
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 /usr/share/snips
|
unzip -o -u "/share/$ASSISTANT" -d /usr/share/snips
|
||||||
# otherwise use the default
|
# otherwise use the default
|
||||||
elif [ -f "/assistant-default.zip" ]; then
|
elif [ -f "/assistant-default.zip" ]; then
|
||||||
echo "[INFO] Using default snips assistant"
|
echo "[INFO] Using default snips assistant"
|
||||||
unzip -o -u "/assistant-default.zip" -d /usr/share/snips
|
unzip -o -u "/assistant-default.zip" -d /usr/share/snips
|
||||||
|
|||||||
Reference in New Issue
Block a user