Skip to content

Commit

Permalink
Merge pull request #3151 from keesschollaart81/dev
Browse files Browse the repository at this point in the history
  • Loading branch information
frenck authored Sep 28, 2024
2 parents f75caf3 + 748a03a commit 0ad2129
Show file tree
Hide file tree
Showing 20 changed files with 689 additions and 569 deletions.
979 changes: 523 additions & 456 deletions package-lock.json

Large diffs are not rendered by default.

6 changes: 3 additions & 3 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.40.2",
"version": "1.41.0",
"preview": false,
"engines": {
"vscode": "^1.45.1"
Expand Down Expand Up @@ -426,7 +426,7 @@
"prepare": "husky install"
},
"devDependencies": {
"@types/mocha": "10.0.1",
"@types/mocha": "10.0.6",
"@types/node": "20.4.8",
"@types/request": "2.48.12",
"@types/vscode": "1.45.1",
Expand All @@ -445,7 +445,7 @@
"typescript-json-schema": "0.62.0"
},
"dependencies": {
"axios": "^1.6.2",
"axios": "^1.6.8",
"bufferutil": "^4.0.8",
"home-assistant-js-websocket": "^9.1.0",
"utf-8-validate": "^6.0.3",
Expand Down
58 changes: 29 additions & 29 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.40.2",
"version": "1.41.0",
"description": "Home Assistant Language Service",
"source": "src/haLanguageService.ts",
"main": "dist/haLanguageService.js",
Expand Down Expand Up @@ -61,7 +61,7 @@
"vscode-json-languageservice": "3.9.1",
"vscode-languageserver-protocol": "3.15.3",
"vscode-uri": "3.0.8",
"ws": "8.16.0",
"ws": "8.17.1",
"yaml": "1.10.2",
"yaml-language-server": "0.12.0"
},
Expand Down
1 change: 1 addition & 0 deletions src/language-service/src/completionHelpers/entityIds.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ export class EntityIdCompletionContribution implements JSONWorkerContribution {
"scene",
"zone",
"zones",
"group_members",
];

constructor(private haConnection: IHaConnection) {}
Expand Down
24 changes: 22 additions & 2 deletions src/language-service/src/schemas/integrations/actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,10 @@ import {
Data,
Deprecated,
Entities,
Floor,
IncludeList,
Integer,
Label,
SceneEntity,
Template,
TimePeriod,
Expand Down Expand Up @@ -362,10 +364,16 @@ export interface ServiceAction {
continue_on_error?: boolean;

/**
* The most important action is the action to call a service.
* The 'service' keyword is being replaced by 'action' keyword
* https://www.home-assistant.io/blog/2024/08/07/release-20248/#goodbye-service-calls-hello-actions-
*/
service?: Deprecated;

/**
* The most important action is to call an action.
* https://www.home-assistant.io/docs/scripts/service-calls/
*/
service?: string;
action?: string;

/**
* DEPRECATED as of Home Assistant 0.115.
Expand Down Expand Up @@ -416,6 +424,18 @@ export interface ServiceAction {
* https://www.home-assistant.io/docs/scripts/service-calls
*/
area_id?: Area | Area[] | "none";

/**
* The floor (or floors) to execute this service call on.
* https://www.home-assistant.io/docs/scripts/service-calls
*/
floor_id?: Floor | Floor[] | "none";

/**
* The labels (or labels) to execute this service call on.
* https://www.home-assistant.io/docs/scripts/service-calls
*/
label_id?: Label | Label[] | "none";
}
| Template;

Expand Down
30 changes: 30 additions & 0 deletions src/language-service/src/schemas/integrations/core/automation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,12 @@ interface BaseItem {
* https://www.home-assistant.io/docs/automation/basics/
*/
condition?: Condition | Condition[] | DynamicTemplate | IncludeList;

/**
* Conditions are optional tests that can limit an automation rule to only work in your specific use cases. A condition will test against the current state of the system. This includes the current time, devices, people and other things like the sun.
* https://www.home-assistant.io/docs/automation/basics/
*/
conditions?: Condition | Condition[] | DynamicTemplate | IncludeList;
}

export interface AutomationItem extends BaseItem {
Expand All @@ -108,6 +114,12 @@ export interface AutomationItem extends BaseItem {
*/
trigger: Trigger | Trigger[] | IncludeList;

/**
* Triggers describe events that should trigger the automation rule.
* https://www.home-assistant.io/docs/automation/basics/
*/
triggers: Trigger | Trigger[] | IncludeList;

/**
* Available in trigger templates with the difference that only limited templates can be used to pass a value to the trigger variable.
* https://www.home-assistant.io/docs/automation/trigger#trigger-variables
Expand All @@ -119,6 +131,12 @@ export interface AutomationItem extends BaseItem {
* https://www.home-assistant.io/docs/automation/basics/
*/
action: Action | Action[] | IncludeList;

/**
* The action(s) which will be performed when a rule is triggered and all conditions are met. For example, it can turn a light on, set the temperature on your thermostat or activate a scene.
* https://www.home-assistant.io/docs/automation/basics/
*/
actions: Action | Action[] | IncludeList;
}

interface BlueprintItem extends BaseItem {
Expand All @@ -133,9 +151,21 @@ interface BlueprintItem extends BaseItem {
*/
trigger?: Trigger | Trigger[] | IncludeList;

/**
* Triggers describe events that should trigger the automation rule.
* https://www.home-assistant.io/docs/automation/basics/
*/
triggers?: Trigger | Trigger[] | IncludeList;

/**
* The action(s) which will be performed when a rule is triggered and all conditions are met. For example, it can turn a light on, set the temperature on your thermostat or activate a scene.
* https://www.home-assistant.io/docs/automation/basics/
*/
action?: Action | Action[] | IncludeList;

/**
* The action(s) which will be performed when a rule is triggered and all conditions are met. For example, it can turn a light on, set the temperature on your thermostat or activate a scene.
* https://www.home-assistant.io/docs/automation/basics/
*/
actions?: Action | Action[] | IncludeList;
}
4 changes: 0 additions & 4 deletions src/language-service/src/schemas/integrations/core/camera.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,3 @@ interface OtherPlatform extends PlatformSchema {
}

type Item = OtherPlatform;

export type SupportedFeature =
| "camera.CameraEntityFeature.ON_OFF"
| "camera.CameraEntityFeature.STREAM";
9 changes: 0 additions & 9 deletions src/language-service/src/schemas/integrations/core/climate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,3 @@ interface OtherPlatform extends PlatformSchema {
}

type Item = OtherPlatform;

export type SupportedFeature =
| "climate.ClimateEntityFeature.TARGET_TEMPERATURE"
| "climate.ClimateEntityFeature.TARGET_TEMPERATURE_RANGE"
| "climate.ClimateEntityFeature.TARGET_HUMIDITY"
| "climate.ClimateEntityFeature.FAN_MODE"
| "climate.ClimateEntityFeature.PRESET_MODE"
| "climate.ClimateEntityFeature.SWING_MODE"
| "climate.ClimateEntityFeature.AUX_HEAT";
10 changes: 0 additions & 10 deletions src/language-service/src/schemas/integrations/core/cover.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,3 @@ interface OtherPlatform extends PlatformSchema {
}

type Item = TemplatePlatformSchema | OtherPlatform;

export type SupportedFeature =
| "cover.CoverEntityFeature.OPEN"
| "cover.CoverEntityFeature.CLOSE"
| "cover.CoverEntityFeature.SET_POSITION"
| "cover.CoverEntityFeature.STOP"
| "cover.CoverEntityFeature.OPEN_TILT"
| "cover.CoverEntityFeature.CLOSE_TILT"
| "cover.CoverEntityFeature.STOP_TILT"
| "cover.CoverEntityFeature.SET_TILT_POSITION";
6 changes: 0 additions & 6 deletions src/language-service/src/schemas/integrations/core/fan.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,3 @@ interface OtherPlatform extends PlatformSchema {
}

type Item = TemplatePlatformSchema | OtherPlatform;

export type SupportedFeature =
| "fan.FanEntityFeature.SET_SPEED"
| "fan.FanEntityFeature.OSCILLATE"
| "fan.FanEntityFeature.DIRECTION"
| "fan.FanEntityFeature.PRESET_MODE";
2 changes: 1 addition & 1 deletion src/language-service/src/schemas/integrations/core/http.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* HTTP ntegration
* HTTP integration
* Source: https://github.com/home-assistant/core/blob/dev/homeassistant/components/http/__init__.py
*/
import { Deprecated, IncludeList, Port, PositiveInteger } from "../../types";
Expand Down
2 changes: 1 addition & 1 deletion src/language-service/src/schemas/integrations/core/knx.ts
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,7 @@ interface BinarySensor {
* Actively read the value from the bus.
* https://www.home-assistant.io/integrations/knx#sync_state
*/
sync_state?: boolean | string;
sync_state?: boolean | number | string;
}

interface Button {
Expand Down
5 changes: 0 additions & 5 deletions src/language-service/src/schemas/integrations/core/light.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,3 @@ interface OtherPlatform extends PlatformSchema {
}

type Item = GroupPlatformSchema | TemplatePlatformSchema | OtherPlatform;

export type SupportedFeature =
| "light.LightEntityFeature.EFFECT"
| "light.LightEntityFeature.FLASH"
| "light.LightEntityFeature.TRANSITION";
2 changes: 0 additions & 2 deletions src/language-service/src/schemas/integrations/core/lock.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,3 @@ interface OtherPlatform extends PlatformSchema {
}

type Item = TemplatePlatformSchema | OtherPlatform;

export type SupportedFeature = "lock.LockEntityFeature.OPEN";
6 changes: 0 additions & 6 deletions src/language-service/src/schemas/integrations/core/update.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,3 @@
*/

export type Domain = "update";
export type SupportedFeature =
| "update.UpdateEntityFeature.INSTALL"
| "update.UpdateEntityFeature.SPECIFIC_VERSION"
| "update.UpdateEntityFeature.PROGRESS"
| "update.UpdateEntityFeature.BACKUP"
| "update.UpdateEntityFeature.RELEASE_NOTES";
Loading

0 comments on commit 0ad2129

Please sign in to comment.