Skip to content

Commit

Permalink
Merge pull request #2760 from keesschollaart81/dev
Browse files Browse the repository at this point in the history
  • Loading branch information
frenck authored Jul 27, 2023
2 parents d4e62c9 + 8bf07bb commit 051d0d0
Show file tree
Hide file tree
Showing 6 changed files with 89 additions and 46 deletions.
60 changes: 30 additions & 30 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "vscode-home-assistant",
"displayName": "Home Assistant Config Helper",
"description": " Completion for entity-id's in Home Assistant Configurations",
"version": "1.37.0",
"version": "1.38.0",
"preview": false,
"engines": {
"vscode": "^1.45.1"
Expand Down Expand Up @@ -427,7 +427,7 @@
},
"devDependencies": {
"@types/mocha": "10.0.1",
"@types/node": "20.4.2",
"@types/node": "20.4.5",
"@types/request": "2.48.8",
"@types/vscode": "1.45.1",
"@types/ws": "8.5.5",
Expand All @@ -436,12 +436,12 @@
"eslint": "^7.32.0",
"eslint-config-prettier": "^8.8.0",
"husky": "^8.0.3",
"lint-staged": "^13.2.2",
"lint-staged": "^13.2.3",
"prettier": "^3.0.0",
"rimraf": "5.0.1",
"ts-loader": "^9.4.3",
"ts-loader": "^9.4.4",
"ts-node": "10.9.1",
"typescript": "^5.1.3",
"typescript": "^5.1.6",
"typescript-json-schema": "0.59.0"
},
"dependencies": {
Expand Down
18 changes: 9 additions & 9 deletions src/language-service/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions src/language-service/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "home-assistant-language-service",
"version": "1.37.0",
"version": "1.38.0",
"description": "Home Assistant Language Service",
"source": "src/haLanguageService.ts",
"main": "dist/haLanguageService.js",
Expand Down Expand Up @@ -39,7 +39,7 @@
},
"devDependencies": {
"@types/mocha": "10.0.1",
"@types/node": "20.4.2",
"@types/node": "20.4.5",
"@types/vscode": "1.48.0",
"@types/ws": "8.5.5",
"@types/yaml": "1.9.7",
Expand Down
34 changes: 34 additions & 0 deletions src/language-service/src/schemas/integrations/triggers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import {

export type Trigger =
| CalendarTrigger
| ConversationTrigger
| DeviceTrigger
| EventTrigger
| GeolocationTrigger
Expand Down Expand Up @@ -115,6 +116,39 @@ interface CalendarTrigger {
variables?: Data;
}

interface ConversationTrigger {
/**
* Alias for the conversation pattern trigger.
*/
alias?: string;

/**
* With the sentence trigger, you can match a sentence from a voice assistant.
* https://www.home-assistant.io/docs/automation/trigger/#sentence-trigger
*/
platform: "conversation";

/**
* Every individual trigger in an automation can be disabled, without removing it.
* https://www.home-assistant.io/docs/automation/trigger/#disabling-a-trigger
*/
enabled?: boolean;

/**
* A sentence or a list of sentences for this trigger.
* https://www.home-assistant.io/docs/automation/trigger/#sentence-trigger
*/
command: string | string[];

/**
* This allows you to define variables that will be set when the trigger fires.
* These can be used in the automation actions or conditions. Templates
* can be used in these variables.
* https://www.home-assistant.io/docs/automation/trigger#trigger-variables
*/
variables?: Data;
}

/**
* @TJS-additionalProperties true
*/
Expand Down
9 changes: 9 additions & 0 deletions src/snippets/homeassistant_automation.json
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,15 @@
],
"description": "Add a Home Assistant time_pattern trigger for automation"
},
"trigger conversation": {
"prefix": "trigger-conversation",
"body": [
"- platform: conversation",
" command:",
" - \"${1:my sentence}\""
],
"description": "Add a Home Assistant conversation trigger for automation"
},
"action service": {
"prefix": "action-service",
"body": [
Expand Down

0 comments on commit 051d0d0

Please sign in to comment.