Skip to content

Commit

Permalink
Merge pull request #381 from keesschollaart81/dev
Browse files Browse the repository at this point in the history
v1.7.2
  • Loading branch information
keesschollaart81 authored Jul 13, 2020
2 parents 669e1a5 + 3551fc0 commit e972ec8
Show file tree
Hide file tree
Showing 13 changed files with 166 additions and 51 deletions.
12 changes: 2 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<img src="https://raw.githubusercontent.com/keesschollaart81/vscode-home-assistant/dev/assets/header.png" alt="Home Assistant Config Helper for Visual Studio Code"/>

[![Marketplace Version](https://vsmarketplacebadge.apphb.com/version/keesschollaart.vscode-home-assistant.svg "Current Release")](https://marketplace.visualstudio.com/items?itemName=keesschollaart.vscode-home-assistant) [![Build Status](https://caseonline.visualstudio.com/vscode-home-assistant/_apis/build/status/keesschollaart81.vscode-home-assistant?branchName=master)](https://caseonline.visualstudio.com/vscode-home-assistant/_build/index?definitionId=23)
[![Marketplace Version](https://vsmarketplacebadge.apphb.com/version/keesschollaart.vscode-home-assistant.svg "Current Release")](https://marketplace.visualstudio.com/items?itemName=keesschollaart.vscode-home-assistant) [![GitHub release](https://img.shields.io/github/release-pre/keesschollaart81/vscode-home-assistant.svg)](https://github.com/keesschollaart81/vscode-home-assistant/releases)

</h1>

Expand Down Expand Up @@ -86,15 +86,7 @@ Create an [issue](https://github.com/keesschollaart81/vscode-home-assistant/issu
- [ ] Go to Definition for entities, scripts and automations
- [ ] Autocomplete !secrets
- [ ] Check local config with HA Server

# Build & Deployment status

| | Master | Dev |
|--------------------------------|-----------------|-----------------|
| Build status | [![Build Status](https://caseonline.visualstudio.com/vscode-home-assistant/_apis/build/status/keesschollaart81.vscode-home-assistant?branchName=master)](https://caseonline.visualstudio.com/vscode-home-assistant/_build/index?definitionId=23) | [![Build Status](https://caseonline.visualstudio.com/vscode-home-assistant/_apis/build/status/keesschollaart81.vscode-home-assistant?branchName=dev)](https://caseonline.visualstudio.com/vscode-home-assistant/_build/index?definitionId=23)
| Deployment Status | [![Deployment Status](https://caseonline.vsrm.visualstudio.com/_apis/public/Release/badge/b5e7419e-352f-433e-8690-463d52b2c4f7/1/2)](https://caseonline.visualstudio.com/vscode-home-assistant/_releases2?definitionId=1) |[![Deployment Status](https://caseonline.vsrm.visualstudio.com/_apis/public/Release/badge/b5e7419e-352f-433e-8690-463d52b2c4f7/1/1)](https://caseonline.visualstudio.com/vscode-home-assistant/_releases2?definitionId=1)|
| Get it | [![Marketplace Version](https://vsmarketplacebadge.apphb.com/version/keesschollaart.vscode-home-assistant.svg "Current Release")](https://marketplace.visualstudio.com/items?itemName=keesschollaart.vscode-home-assistant) | [![GitHub release](https://img.shields.io/github/release-pre/keesschollaart81/vscode-home-assistant.svg)](https://github.com/keesschollaart81/vscode-home-assistant/releases)|


# Telemetry

This extension collects telemetry data to help us build a better experience for
Expand Down
8 changes: 4 additions & 4 deletions package-lock.json

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

18 changes: 3 additions & 15 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,29 +2,17 @@
"name": "vscode-home-assistant",
"displayName": "Home Assistant Config Helper",
"description": " Completion for entity-id's in Home Assistant Configurations",
"version": "1.7.1",
"version": "1.7.2",
"preview": false,
"engines": {
"vscode": "^1.47.0"
"vscode": "^1.45.1"
},
"categories": [
"Other",
"Programming Languages",
"Formatters",
"Snippets"
],
"badges": [
{
"url": "https://caseonline.visualstudio.com/vscode-home-assistant/_apis/build/status/keesschollaart81.vscode-home-assistant?branchName=master",
"href": "https://caseonline.visualstudio.com/vscode-home-assistant/_build/index?definitionId=23",
"description": "Azure Pipelines | Build"
},
{
"url": "https://caseonline.vsrm.visualstudio.com/_apis/public/Release/badge/b5e7419e-352f-433e-8690-463d52b2c4f7/1/2",
"href": "https://caseonline.visualstudio.com/vscode-home-assistant/_releases2?definitionId=1",
"description": "Azure Pipelines | Release"
}
],
"publisher": "keesschollaart",
"repository": {
"type": "git",
Expand Down Expand Up @@ -230,7 +218,7 @@
"@types/mocha": "8.0.0",
"@types/node": "14.0.22",
"@types/request": "2.48.5",
"@types/vscode": "^1.47.0",
"@types/vscode": "1.45.1",
"@types/ws": "7.2.6",
"@typescript-eslint/eslint-plugin": "^3.6.0",
"@typescript-eslint/parser": "^3.6.0",
Expand Down
8 changes: 4 additions & 4 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.7.0",
"version": "1.7.2",
"description": "Home Assistant Language Service",
"source": "src/haLanguageService.ts",
"main": "dist/haLanguageService.js",
Expand Down Expand Up @@ -40,7 +40,7 @@
"devDependencies": {
"@types/mocha": "8.0.0",
"@types/node": "14.0.22",
"@types/vscode": "^1.47.0",
"@types/vscode": "1.45.1",
"@types/ws": "7.2.6",
"@types/yaml": "1.9.7",
"@typescript-eslint/eslint-plugin": "^3.6.0",
Expand Down
18 changes: 6 additions & 12 deletions src/language-service/src/schemas/actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
* Source: https://github.com/home-assistant/core/blob/dev/homeassistant/helpers/config_validation.py
*/
import {
Data,
DataTemplate,
Entity,
EntityScene,
IncludeList,
Expand Down Expand Up @@ -67,17 +69,13 @@ export interface EventAction {
* The event data to pass along.
* https://www.home-assistant.io/docs/scripts/#fire-an-event
*/
event_data?: {
[key: string]: any;
};
event_data?: Data;

/**
* The event data to pass along, using script template.
* https://www.home-assistant.io/docs/scripts/#fire-an-event
*/
event_data_template?: {
[key: string]: any | Template;
};
event_data_template?: DataTemplate;
}

export interface RepeatAction {
Expand Down Expand Up @@ -148,17 +146,13 @@ export interface ServiceAction {
* Specify other parameters beside the entity to target. For example, the light turn on service allows specifying the brightness.
* https://www.home-assistant.io/docs/scripts/service-calls/#passing-data-to-the-service-call
*/
data?: {
[key: string]: any;
};
data?: Data;

/**
* Specify other parameters based on templates.
* https://www.home-assistant.io/docs/scripts/service-calls/#use-templates-to-determine-the-attributes
*/
data_template?: {
[key: string]: Template;
};
data_template?: DataTemplate;

/**
* The entity (or entities) to execute this service call on.
Expand Down
12 changes: 12 additions & 0 deletions src/language-service/src/schemas/core.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,18 @@ export interface Core {
*/
elevation?: number | Secret;

/**
* The URL that Home Assistant is available on from the internet. For example: https://example.duckdns.org:8123. Note that this setting may only contain a protocol, hostname and port; using a path is not supported.
* https://www.home-assistant.io/docs/configuration/basic/#external_url
*/
external_url?: string | Secret;

/**
* The URL that Home Assistant is available on from your local network. For example: http://homeassistant.local:8123. Note that this setting may only contain a protocol, hostname and port; using a path is not supported.
* https://www.home-assistant.io/docs/configuration/basic/#internal_url
*/
internal_url?: string | Secret;

/**
* Latitude of your location required to calculate the time the sun rises and sets.
* https://www.home-assistant.io/docs/configuration/basic/#latitude
Expand Down
8 changes: 7 additions & 1 deletion src/language-service/src/schemas/homeassistant.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,17 @@ export interface InternalIntegrations {
*/
group?: integrations.Group.Schema | IncludeNamed;

/**
* The http integration serves all files and data required for the Home Assistant frontend. You only need to add this to your configuration file if you want to change any of the default settings.
* https://www.home-assistant.io/integrations/http
*/
http?: integrations.HTTP.Schema | IncludeNamed | null;

/**
* The input_boolean integration allows the user to define boolean values that can be controlled via the frontend and can be used within conditions of automation. This can for example be used to disable or enable certain automations.
* https://www.home-assistant.io/integrations/input_boolean
*/
input_boolean?: integrations.InputBoolean.Schema | IncludeNamed;
input_boolean?: integrations.InputBoolean.Schema | IncludeNamed | null;

/**
* The panel_iframe support allows you to add additional panels to your Home Assistant frontend. The panels are listed in the sidebar and can contain external resources like the web frontend of your router, your monitoring system, or your media server.
Expand Down
5 changes: 2 additions & 3 deletions src/language-service/src/schemas/integrations/automation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
* Source: https://github.com/home-assistant/core/blob/dev/homeassistant/components/automation/__init__.py
*/
import {
Data,
Deprecated,
Entity,
EntityDeviceTracker,
Expand Down Expand Up @@ -130,9 +131,7 @@ interface TriggerEvent {
* Additional event data that has to match before triggering.
* https://www.home-assistant.io/docs/automation/trigger/#event-trigger
*/
event_data?: {
[key: string]: any;
};
event_data?: Data;

/**
* The name of the event to listen for.
Expand Down
95 changes: 95 additions & 0 deletions src/language-service/src/schemas/integrations/http.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
/**
* HTTP ntegration
* Source: https://github.com/home-assistant/core/blob/dev/homeassistant/components/http/__init__.py
*/
import {
Deprecated,
IncludeList,
Port,
PositiveInteger,
Secret,
} from "../types";

export type Domain = "http";
export interface Schema {
/**
* DEPRECATED.
* The base URL has been deprecated, please use internal_url and external_url instead.
*/
base_url?: Deprecated;

/**
* A list of origin domain names to allow CORS requests from. Enabling this will set the Access-Control-Allow-Origin header to the Origin header if it is found in the list, and the Access-Control-Allow-Headers header to Origin, Accept, X-Requested-With, Content-type, Authorization.
* https://www.home-assistant.io/integrations/http#cors_allowed_origins
*/
cors_allowed_origins?: string | string[] | Secret | Secret[] | IncludeList;

/**
* Flag indicating whether additional IP filtering is enabled.
* https://www.home-assistant.io/integrations/http#ip_ban_enabled
*/
ip_ban_enabled?: boolean;

/**
* Number of failed login attempt from single IP after which it will be automatically banned if ip_ban_enabled is true.
* https://www.home-assistant.io/integrations/http#login_attempts_threshold
*/
login_attempts_threshold?: PositiveInteger;

/**
* Only listen to incoming requests on specific IP/host. By default it will accept all IPv4 connections. Use server_host: ::0 if you want to listen to (and only) IPv6.
* Warning! Only use this option when you run Home Assistant Core directly in Python!
* https://www.home-assistant.io/integrations/http#server_host
*/
server_host?: string | Secret;

/**
* Let you set a port for Home Assistant to run on.
* https://www.home-assistant.io/integrations/http#server_port
*/
server_port?: Port;

/**
* Path to your TLS/SSL certificate to serve Home Assistant over a secure connection.
* https://www.home-assistant.io/integrations/http#ssl_certificate
*/
ssl_certificate?: string | Secret;

/**
* Path to your TLS/SSL key to serve Home Assistant over a secure connection.
* https://www.home-assistant.io/integrations/http#ssl_key
*/
ssl_key?: string | Secret;

/**
* Path to the client/peer TLS/SSL certificate to accept secure connections from.
* https://www.home-assistant.io/integrations/http#ssl_peer_certificate
*/
ssl_peer_certificate?: string | Secret;

/**
* The Mozilla SSL profile to use. Only lower if you are experiencing integrations causing SSL handshake errors.
* Can be either "modern" or "intermediate". Modern is the default.
* https://www.home-assistant.io/integrations/http#ssl_profile
*/
ssl_profile?: "modern" | "intermediate";

/**
* DEPRECATED.
* This option has no effect. Please remove this from your configuration.
*/
trusted_networks?: Deprecated;

/**
* List of trusted proxies, consisting of IP addresses or networks, that are allowed to set the X-Forwarded-For header. This is required when using use_x_forwarded_for because all requests to Home Assistant, regardless of source, will arrive from the reverse proxy IP address.
* This option should be handled and set with extreme care!
* https://www.home-assistant.io/integrations/http#trusted_proxies
*/
trusted_proxies?: string | string[] | Secret | Secret[] | IncludeList;

/**
* Enable parsing of the X-Forwarded-For header, passing on the client’s correct IP address in proxied setups. You must also whitelist trusted proxies using the trusted_proxies setting for this to work. Non-whitelisted requests with this header will be considered IP spoofing attacks, and the header will, therefore, be ignored.
* https://www.home-assistant.io/integrations/http#use_x_forwarded_for
*/
use_x_forwarded_for?: boolean;
}
1 change: 1 addition & 0 deletions src/language-service/src/schemas/integrations/index.d.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
export * as Automation from "./automation";
export * as Group from "./group";
export * as HACS from "./hacs";
export * as HTTP from "./http";
export * as Hue from "./hue";
export * as InputBoolean from "./input_boolean";
export * as PanelIframe from "./panel_iframe";
Expand Down
7 changes: 7 additions & 0 deletions src/language-service/src/schemas/mappings.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,13 @@
"tsFile": "integrations/scene.ts",
"fromType": "Schema"
},
{
"key": "homeassistant-http",
"path": "configuration.yaml/http",
"file": "homeassistant-http.json",
"tsFile": "integrations/http.ts",
"fromType": "Schema"
},
{
"key": "homeassistant-input-boolean",
"path": "configuration.yaml/input_boolean",
Expand Down
21 changes: 21 additions & 0 deletions src/language-service/src/schemas/types.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
export type Data = {
[key: string]: any;
};

export type DataTemplate = {
[key: string]: any | Template;
};

/**
* @TJS-pattern DEPRECATED^
*/
Expand Down Expand Up @@ -100,6 +108,19 @@ export type IncludeNamed = string;
*/
export type Integer = number;

/**
* @JTS-type integer
* @minimum 0
*/
export type PositiveInteger = number;

/**
* @JTS-type integer
* @minimum 1
* @maximum 65535
*/
export type Port = number;

/**
* @TJS-pattern ^!secret\s([a-zA-Z0-9_-]+)$
*/
Expand Down

0 comments on commit e972ec8

Please sign in to comment.