Improve validation of device automation config#26830
Closed
emontnemery wants to merge 5 commits into
Closed
Conversation
balloob
reviewed
Sep 22, 2019
balloob
reviewed
Sep 24, 2019
| automations = [] | ||
| for _, p_config in config_per_platform(config, DOMAIN): | ||
| try: | ||
| p_validated = await async_validate_config_item(hass, p_config) |
Member
There was a problem hiding this comment.
Let's use asyncio.gather to run in parallel.
balloob
reviewed
Sep 24, 2019
| ) | ||
|
|
||
|
|
||
| async def async_trigger(hass, config, action, automation_info): |
Member
There was a problem hiding this comment.
I am renaming this in #26871 to async_attach_trigger
balloob
reviewed
Sep 24, 2019
| Script(hass, cv.SCRIPT_SCHEMA(config)).run(variables, context) | ||
|
|
||
|
|
||
| async def async_validate_action_config( |
Member
There was a problem hiding this comment.
This should be async_validate_script_config
Member
There was a problem hiding this comment.
Also could be used inside the script integration.
balloob
reviewed
Sep 24, 2019
| _LOGGER.error("Unable to import %s: %s", domain, ex) | ||
| return None | ||
|
|
||
| if hasattr(component, "async_validate_config"): |
Member
|
Any PR related to device automation should be broken up into 3 PRs. One for triggers, conditions and actions all separately. |
5 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description:
Improve validation of device automation config.
Improve both when loading at startup, and when an automation is modified through the automation editor UI.
Split in three PRs: #26910, #27029, #27131,
Checklist:
tox. Your PR cannot be merged unless tests passIf the code does not interact with devices: