Skip to content

Commit

Permalink
* (Apollon77) Add support vor Custom Skill v2
Browse files Browse the repository at this point in the history
  • Loading branch information
Apollon77 committed Dec 8, 2022
1 parent 1ff0cd3 commit b04659b
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 7 deletions.
4 changes: 2 additions & 2 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ updates:
interval: monthly
time: "04:00"
timezone: Europe/Berlin
open-pull-requests-limit: 20
open-pull-requests-limit: 5
versioning-strategy: increase
- package-ecosystem: npm
directory: "/src"
Expand All @@ -21,4 +21,4 @@ updates:
time: "04:00"
timezone: Europe/Berlin
open-pull-requests-limit: 20
versioning-strategy: increase
versioning-strategy: increase
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,10 @@ Following types are supported:
-->

## Changelog

### __WORK IN PROGRESS__
* (Apollon77) Add support vor Custom Skill v2

### 1.12.5 (2022-11-09)
* (bluefox) Small changes on configuration GUI

Expand Down
8 changes: 6 additions & 2 deletions lib/alexaCustom.js
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,10 @@ function AlexaCustom(adapter) {
}

function getResponseV2(text, repromptText, shouldEndSession) {
if (typeof repromptText === 'boolean') {
shouldEndSession = repromptText;
repromptText = null;
}
const response = getResponseV1(text, repromptText, shouldEndSession);

if (!shouldEndSession) {
Expand Down Expand Up @@ -428,7 +432,7 @@ function AlexaCustom(adapter) {
}
}
callback(getResponse(response, response));
} else if (intent === 'queryIntent' && stopPhrases.includes(text.toLowerCase())) {
} else if (intent === 'queryIntent' && stopPhrases[lang].includes(text.toLowerCase())) {
// v2 Skill when in dialog mode we need to take care of the exit criteria ourselves
if (lang === 'en') {
callback(getResponse('Goodbye!', true));
Expand Down Expand Up @@ -506,7 +510,7 @@ function AlexaCustom(adapter) {

adapter.setState('smart.lastResponse', result.response, true);
if (callback) {
callback(getResponse(result.response, !openSessions[sessionId]));
callback(getResponse(result.response, true));
callback = null;
}
});
Expand Down
7 changes: 4 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,15 @@
"jsdom": "^20.0.3",
"mime": "^3.0.0",
"moment": "^2.29.4",
"axios": "^1.2.0",
"axios": "^1.2.1",
"uuid": "^9.0.0"
},
"devDependencies": {
"@alcalzone/release-script": "^3.5.9",
"@alcalzone/release-script-plugin-iobroker": "^3.5.9",
"@alcalzone/release-script-plugin-license": "^3.5.9",
"@types/iobroker": "^4.0.5",
"@types/node": "^18.11.10",
"@types/node": "^18.11.11",
"chai": "^4.3.7",
"del": "^6.1.1",
"gulp": "^4.0.2",
Expand All @@ -68,7 +68,8 @@
"release": "release-script",
"release-patch": "release-script patch --yes",
"release-minor": "release-script minor --yes",
"release-major": "release-script major --yes"
"release-major": "release-script major --yes",
"translate": "translate-adapter"
},
"license": "MIT",
"readmeFilename": "README.md"
Expand Down

0 comments on commit b04659b

Please sign in to comment.