home-assistant / core

:house_with_garden: Open source home automation that puts local control and privacy first.
https://www.home-assistant.io
Apache License 2.0
71.41k stars 29.9k forks source link

Supported features in blueprint imports are transformed to invalid values #103431

Open ludeeus opened 10 months ago

ludeeus commented 10 months ago

The problem

I have a blueprint with this input:

  input:
    update_entity:
      name: Update entities
      description: The update entities that should be controlled
      selector:
        entity:
          filter:
            domain: update
            supported_features: [update.UpdateEntityFeature.SPECIFIC_VERSION]

And this is working the way I expect it to work, I'm only able to select entities matching that filter. But if someone is importing this blueprint from URL, the supported_features part is transformed into an invalid value.

This is the resulting input after using the import feature:

  input:
    update_entity:
      name: Update entities
      description: The update entities that should be controlled
      selector:
        entity:
          filter:
          - domain:
            - update
            supported_features:
            - 2
          multiple: true

The UI allows this and the selector is rendered with the expected filter, but when you save an automation that uses this you will get an error like this:

There is an error in this Blueprint: Invalid blueprint: expected str @ data['blueprint']['input']['update_entity']['selector']['filter'][0]['supported_features'][0][0]. Got None

What version of Home Assistant Core has the issue?

core-2023.10.5

What was the last working version of Home Assistant Core?

Unknown if this has ever worked

What type of installation are you running?

Home Assistant OS

Integration causing the issue

blueprint

Link to integration documentation on our website

https://www.home-assistant.io/docs/automation/using_blueprints/

Diagnostics information

No response

Example YAML snippet

No response

Anything in the logs that might be useful for us?

No response

Additional information

No response

home-assistant[bot] commented 10 months ago

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

Code owner commands Code owners of `blueprint` 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 blueprint` Removes the current integration label and assignees on the issue, add the integration domain after the command.

(message by CodeOwnersMention)


blueprint documentation blueprint source (message by IssueLinks)

issue-triage-workflows[bot] commented 7 months ago

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates. Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment πŸ‘ This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.

ludeeus commented 7 months ago

Still a problem in current dev

issue-triage-workflows[bot] commented 4 months ago

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates. Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment πŸ‘ This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.

ludeeus commented 4 months ago

Tested again now on dev (4fce99edb58e999dc57748b629e159f46d6dd95c) still a problem.

issue-triage-workflows[bot] commented 1 month ago

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates. Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment πŸ‘ This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.

ludeeus commented 1 month ago

I give up, just close it.