ctrl+shift+p filters: :st2 :st3 :win :osx :linux
Browse

LSP-esphome

by sublimelsp ST4 New

Validation, completion and hover help for ESPHome Yaml files.

Labels lsp, esphome

Details

Installs

  • Total 0
  • Win 0
  • Mac 0
  • Linux 0
Feb 4 Feb 3 Feb 2 Feb 1 Jan 31 Jan 30 Jan 29 Jan 28 Jan 27 Jan 26 Jan 25 Jan 24 Jan 23 Jan 22 Jan 21 Jan 20 Jan 19 Jan 18 Jan 17 Jan 16 Jan 15 Jan 14 Jan 13 Jan 12 Jan 11 Jan 10 Jan 9 Jan 8 Jan 7 Jan 6 Jan 5 Jan 4 Jan 3 Jan 2 Jan 1 Dec 31 Dec 30 Dec 29 Dec 28 Dec 27 Dec 26 Dec 25 Dec 24 Dec 23 Dec 22
Windows 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
Mac 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
Linux 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0

Readme

Source
raw.​githubusercontent.​com

LSP-esphome

Uses esphome-lang-server from esphome-vscode to provide validation, completion and hover help for ESPHome Yaml configuration files.

Installation

  • Install ESPHome syntax
  • Install LSP and LSP-esphome from Package Control.
  • Restart Sublime.

Usage

[!WARNING]

For the server to start the file needs to use the YAML (esphome) syntax. Set it from the Command Palette or from the syntax selector in the status bar.

Since ESPHome configuration files use the .yml/.yaml extension and do not differ much from standard YAML files, there is no easy way to automatically assign it to all ESPHome configuration files (unless you want to use this syntax for all YAML files, which could introduce its own problems). Therefore, it is recommended to use the ApplySyntax or AutoSetSyntax package to assign this syntax based on the file path - most likely on a per-project basis since there is nothing inherently unique about the file names or paths of these configuration files.

Configuration

Open configuration file using Command Palette with Preferences: LSP-esphome Settings command or opening it from the Sublime menu (Preferences > Package Settings > LSP > Servers > LSP-esphome).

The plugin validates against ESPHome itself, so you will get the same errors. You can connect to ESPHome in two different ways:

  1. Use the ESPHome Device Builder, this can be the ESPHome running in Home Assistant, in that case you will need to configure the add-on to leave_front_door_open and also give a TCP port in the addon for external access (in case you are only accessing via Ingress).

  2. Use a local installation of ESPHome. By default uses Python environment managed by this package. If you can run esphome in your terminal or have installed esphome in a virtual environment, then you can override pythonPath in initializationOptions to point at it. In that case it needs point at python executable inside your venv folder or, if Python is in the PATH, the executable name.

Completion and hover help needs to pull schema from https://schema.esphome.io. The schemas are versioned so the extension will first connect to you Device Builder or local ESPHome to retrieve the version you are using and then try to pull the best available matching version. For the dev version it will pull the schemas dev version daily.