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

multiple top-level "!include" statements and splitting of configuration doesn't work for template entities (take 2) #118182

Open
nwf opened this issue May 26, 2024 · 1 comment

Comments

@nwf
Copy link

nwf commented May 26, 2024

The problem

As already described in good detail in the old and yet now marked-stale, closed, and locked without resolution #82449, template configuration items are not, in fact, compatible with labels as blithely asserted in https://www.home-assistant.io/docs/configuration/splitting_configuration/ or, more sourced-ly, at https://github.com/home-assistant/home-assistant.io/blob/926be6ba233fe62c7a1d8c018ad6d3f5617456c5/source/_docs/configuration/splitting_configuration.markdown#L113

This is, I believe a consequence of

for cfg in cv.ensure_list(config[DOMAIN]):

simply keying into the config and not calling config_per_platform as is done by, for example,

I am an absolute novice for anything about HA internals, so if I'm wildly off the mark, I apologize.

IMHO, template should be updated to actually do what the documentation says, which probably requires manually merging each of the domains within, but failing that, the documentation should be adjusted to not get hopes up, yea?

What version of Home Assistant Core has the issue?

core-2024.5.5

What was the last working version of Home Assistant Core?

No response

What type of installation are you running?

Home Assistant OS

Integration causing the issue

template

Link to integration documentation on our website

https://www.home-assistant.io/integrations/template/

Diagnostics information

n/a

Example YAML snippet

No response

Anything in the logs that might be useful for us?

No response

Additional information

By itself,

template foo:

will trigger "Unexpected error calling config validator: 'template'", for reasons I do not understand (presumably something somewhere else understands labels, too?). If in tandem with a real template, as in

template:
template foo:

then the latter (template foo) block will simply be ignored.

As a possible workaround, template does not seem to enforce uniqueness of its child keys, so maybe (untested)

template:
  - sensor:
    - ...
  - sensor: !include_dir_list ...

will do the right thing? If that's true, then perhaps just a documentation update is in order and no code needs to be changed.

@home-assistant
Copy link

Hey there @PhracturedBlue, @tetienne, @home-assistant/core, mind taking a look at this issue as it has been labeled with an integration (template) you are listed as a code owner for? Thanks!

Code owner commands

Code owners of template can trigger bot actions by commenting:

  • @home-assistant close Closes the issue.
  • @home-assistant rename Awesome new title Renames the issue.
  • @home-assistant reopen Reopen the issue.
  • @home-assistant unassign template Removes the current integration label and assignees on the issue, add the integration domain after the command.
  • @home-assistant add-label needs-more-information Add a label (needs-more-information, problem in dependency, problem in custom component) to the issue.
  • @home-assistant remove-label needs-more-information Remove a label (needs-more-information, problem in dependency, problem in custom component) on the issue.

(message by CodeOwnersMention)


template documentation
template source
(message by IssueLinks)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant