Skip to content

Commit

Permalink
Merge pull request #3218 from keesschollaart81/dev
Browse files Browse the repository at this point in the history
  • Loading branch information
frenck authored Oct 5, 2024
2 parents 9827115 + c884201 commit 9c18bf3
Show file tree
Hide file tree
Showing 8 changed files with 236 additions and 148 deletions.
4 changes: 2 additions & 2 deletions package-lock.json

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

2 changes: 1 addition & 1 deletion 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.42.0",
"version": "1.43.0",
"preview": false,
"engines": {
"vscode": "^1.45.1"
Expand Down
4 changes: 2 additions & 2 deletions src/language-service/package-lock.json

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

2 changes: 1 addition & 1 deletion 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.42.0",
"version": "1.43.0",
"description": "Home Assistant Language Service",
"source": "src/haLanguageService.ts",
"main": "dist/haLanguageService.js",
Expand Down
36 changes: 35 additions & 1 deletion src/language-service/src/schemas/integrations/core/blueprint.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ interface Blueprint {
* https://www.home-assistant.io/docs/blueprint/schema/#input
*/
input?: {
[key: string]: BlueprintInputSchema;
[key: string]: BlueprintInputSchema | BlueprintInputSectionSchema;
};

/**
Expand Down Expand Up @@ -102,3 +102,37 @@ interface BlueprintInputSchema {
*/
selector?: Selector;
}

interface BlueprintInputSectionSchema {
/**
* A name for the section. If omitted the key of the section is used.
* https://www.home-assistant.io/docs/blueprint/schema/#name
*/
name?: string;

/**
* An optional description of this section, which will be displayed at the top of the section. The description can include Markdown.
* https://www.home-assistant.io/docs/blueprint/schema/#description
*/
description?: string;

/**
* An icon to display next to the name of the section.
* https://www.home-assistant.io/docs/blueprint/schema/#icon
*/
icon?: string;

/**
* If true, the section will be collapsed by default. Useful for optional or less important inputs. All collapsed inputs must also have a defined default before they can be hidden.
* https://www.home-assistant.io/docs/blueprint/schema/#collapsed
*/
collapsed?: boolean;

/**
* A dictionary of defined user inputs within this section.
* https://www.home-assistant.io/docs/blueprint/schema/#input
*/
input: {
[key: string]: BlueprintInputSchema;
};
}
6 changes: 6 additions & 0 deletions src/language-service/src/schemas/integrations/core/http.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,4 +86,10 @@ export interface Schema {
* https://www.home-assistant.io/integrations/http#use_x_forwarded_for
*/
use_x_forwarded_for?: boolean;

/**
* Controls the `X-Frame-Options` header to help prevent clickjacking.
* https://www.home-assistant.io/integrations/http#use_x_frame_options
*/
use_x_frame_options?: boolean;
}
142 changes: 2 additions & 140 deletions src/language-service/src/schemas/integrations/core/mqtt.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import {
DeviceClassesSensor,
IncludeList,
Integer,
Port,
PositiveInteger,
StateClassesSensor,
Template,
Expand Down Expand Up @@ -41,146 +40,9 @@ type Availability = {
value_template?: Template;
};

export interface Schema {
/**
* Birth Message
* https://www.home-assistant.io/docs/mqtt/birth_will/#birth_message
*/
birth_message?: {
/**
* The MQTT topic to publish the message.
* https://www.home-assistant.io/docs/mqtt/birth_will/#topic
*/
topic?: string;

/**
* The message content.
* https://www.home-assistant.io/docs/mqtt/birth_will/#payload
*/
payload?: string;

/**
* The maximum QoS level of the topic.
* https://www.home-assistant.io/docs/mqtt/birth_will/#qos
*/
qos?: QOS;

/**
* If the published message should have the retain flag on or not.
* https://www.home-assistant.io/docs/mqtt/birth_will/#retain
*/
retain?: boolean;
};

/**
* The IP address or hostname of your MQTT broker, e.g., 192.168.1.32.
* https://www.home-assistant.io/docs/mqtt/broker#broker
*/
broker?: string;

/**
* Path to the certificate file, e.g., /ssl/server.crt.
* https://www.home-assistant.io/docs/mqtt/broker#certificate
*/
certificate?: string;

/**
* Client certificate, e.g., /home/user/owntracks/cookie.crt.
* https://www.home-assistant.io/docs/mqtt/certificate/#client_cert
*/
client_cert?: string;

/**
* The client ID that Home Assistant will use. Has to be unique on the server. Default is a randomly generated one.
* https://www.home-assistant.io/docs/mqtt/broker#client_id
*/
client_id?: string;

/**
* Client key, e.g., /home/user/owntracks/cookie.key.
* https://www.home-assistant.io/docs/mqtt/certificate/#client_key
*/
client_key?: string;

/**
* The prefix for the discovery topic.
* https://www.home-assistant.io/docs/mqtt/discovery/#discovery_prefix
*/
discovery_prefix?: string;

/**
* If the MQTT discovery should be enabled or not.
* https://www.home-assistant.io/docs/mqtt/discovery/#discovery
*/
discovery?: boolean;

/**
* The time in seconds between sending keep alive messages for this client. Default is 60.
* https://www.home-assistant.io/docs/mqtt/broker#keepalive
*
* @min 15
*/
keepalive?: PositiveInteger;

/**
* The corresponding password for the username to use with your MQTT broker.
* https://www.home-assistant.io/docs/mqtt/broker#password
*/
password?: string;

/**
* The network port to connect to. Default is 1883.
*/
port?: Port;

/**
* Protocol to use: 3.1 or 3.1.1. By default it connects with 3.1.1 and falls back to 3.1 if server does not support 3.1.1.
* https://www.home-assistant.io/docs/mqtt/broker#protocol
*/
protocol?: "3.1" | "3.1.1";

/**
* Set the verification of the server hostname in the server certificate.
* https://www.home-assistant.io/docs/mqtt/broker#tls_insecure
*/
tls_insecure?: boolean;

/**
* The username to use with your MQTT broker.
* https://www.home-assistant.io/docs/mqtt/broker#username
*/
username?: string;

/**
* Will Message.
* https://www.home-assistant.io/docs/mqtt/birth_will/#will_message
*/
will_message?: {
/**
* The MQTT topic to publish the message.
* https://www.home-assistant.io/docs/mqtt/birth_will/#topic
*/
topic?: string;

/**
* The message content.
* https://www.home-assistant.io/docs/mqtt/birth_will/#payload
*/
payload?: string;

/**
* The maximum QoS level of the topic.
* https://www.home-assistant.io/docs/mqtt/birth_will/#qos
*/
qos?: QOS;

/**
* If the published message should have the retain flag on or not.
* https://www.home-assistant.io/docs/mqtt/birth_will/#retain
*/
retain?: boolean;
};
export type Schema = Item | Item[];

interface Item {
/**
* The mqtt alarm panel platform enables the possibility to control MQTT capable alarm panels. The Alarm icon will change state after receiving a new state from state_topic.
* https://www.home-assistant.io/integrations/alarm_control_panel.mqtt/
Expand Down
Loading

0 comments on commit 9c18bf3

Please sign in to comment.