Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for Home Assistant schema #42

Open
anoblet opened this issue Dec 6, 2021 · 8 comments · Fixed by #46
Open

Add support for Home Assistant schema #42

anoblet opened this issue Dec 6, 2021 · 8 comments · Fixed by #46
Labels
bug Something isn't working feature New feature or request

Comments

@anoblet
Copy link

anoblet commented Dec 6, 2021

Home Assistant uses custom tags. Please support custom tags such as the following:

example_key: !example_custom_tag example value
@pascalre pascalre added the feature New feature or request label Mar 15, 2022
@pascalre
Copy link
Owner

@anoblet I can add a custom yaml schema with the tags used by Home Assistant. Can you provide a list of all custom tags Home Assistent currently supports? In my research I found these tags:

  • !env_var
  • !include
  • !include_dir_list
  • !include_dir_merge_list
  • !include_dir_merge_named
  • !include_dir_*

@anoblet
Copy link
Author

anoblet commented Mar 15, 2022

I believe these are all of the custom tags that they use:

!env_var
!include
!include_dir_list
!include_dir_named
!include_dir_merge_list
!include_dir_merge_named
  • Adds !include_dir_named, removes !include_dir_*

Thank you for your help!

@pascalre pascalre changed the title add custom tag support Add support for Home Assistant custom tags Mar 16, 2022
@pascalre
Copy link
Owner

@anoblet I just released version 5.2.0 including the fix. Please check out the version and let me know if this fits your needs. If you miss a custom tag, feel free to contribute to the homeassistant-js-yaml-schema.
If you like this extension, I would really appreciate a review on the marketplace. 😊

@pascalre
Copy link
Owner

Forgot to mention: You need to set vscode-yaml-sort.schema to HOMEASSISTANT_SCHEMA to use this feature.

@pascalre pascalre changed the title Add support for Home Assistant custom tags Add support for Home Assistant schema Mar 17, 2022
@anoblet
Copy link
Author

anoblet commented Apr 7, 2022

@pascalre I forgot one!

!secret

@pascalre pascalre linked a pull request Apr 8, 2022 that will close this issue
@pascalre
Copy link
Owner

pascalre commented Apr 8, 2022

@anoblet update to version 5.3.1

@anoblet
Copy link
Author

anoblet commented Apr 8, 2022

Thank you!

@anoblet
Copy link
Author

anoblet commented Apr 15, 2022

I tried using the HOMEASSISTANT_SCHEMA today, and realized that it does not format correctly:

type: custom:flex-card
cards:
  - type: custom:generic-card
    class: relative
    cards:
      - !include bathroom/temperature.yaml
    title: Temperature

->

cards:
  - cards:
      - !include 
        class: include
        data: bathroom/temperature.yaml
        name: include
    class: relative
    title: Temperature
    type: custom:generic-card
type: custom:flex-card

- !include bathroom/temperature.yaml should stay on it's own line with no modifications.

@pascalre pascalre reopened this Apr 28, 2022
@pascalre pascalre added the bug Something isn't working label Oct 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working feature New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants