diff --git a/google_assistant/CHANGELOG.md b/google_assistant/CHANGELOG.md index 930f5cf..e4ad647 100644 --- a/google_assistant/CHANGELOG.md +++ b/google_assistant/CHANGELOG.md @@ -1,5 +1,8 @@ # Changelog +## 1.2 +- Add model id + ## 1.1 - Bugfix OAuth webinterface diff --git a/google_assistant/config.json b/google_assistant/config.json index b85b293..3fdb005 100644 --- a/google_assistant/config.json +++ b/google_assistant/config.json @@ -1,6 +1,6 @@ { "name": "Google Assistant", - "version": "1.1", + "version": "1.2", "slug": "google_assistant", "description": "A virtual personal assistant developed by Google", "url": "https://home-assistant.io/addons/google_assistant/", @@ -14,10 +14,12 @@ }, "webui": "http://[HOST]:[PORT:9324]", "options": { - "client_secrets": "google_assistant.json" + "client_secrets": "google_assistant.json", + "model_id": null }, "schema": { - "client_secrets": "str" + "client_secrets": "str", + "model_id": "str" }, "image": "homeassistant/{arch}-addon-google_assistant" } diff --git a/google_assistant/hassio_gassistant.py b/google_assistant/hassio_gassistant.py index d178f19..51d20b6 100644 --- a/google_assistant/hassio_gassistant.py +++ b/google_assistant/hassio_gassistant.py @@ -27,6 +27,6 @@ if __name__ == '__main__': credentials = google.oauth2.credentials.Credentials(token=None, **json.load(data)) # run assistant - with Assistant(credentials) as assistant: + with Assistant(credentials, sys.argv[2]) as assistant: for event in assistant.start(): process_event(event) diff --git a/google_assistant/run.sh b/google_assistant/run.sh index a23d80b..b1df3ab 100644 --- a/google_assistant/run.sh +++ b/google_assistant/run.sh @@ -6,6 +6,7 @@ CLIENT_JSON=/data/client.json CRED_JSON=/data/cred.json CLIENT_SECRETS=$(jq --raw-output '.client_secrets' $CONFIG_PATH) +MODEL_ID=$(jq --raw-output '.model_id' $CONFIG_PATH) # check if a new assistant file exists if [ -f "/share/$CLIENT_SECRETS" ]; then @@ -21,4 +22,4 @@ elif [ ! -f "$CRED_JSON" ]; then exit 1 fi -exec python3 /hassio_gassistant.py "$CRED_JSON" < /dev/null +exec python3 /hassio_gassistant.py "$CRED_JSON" "$MODEL_ID" < /dev/null