Skip to content

Improve validation of device action config#27029

Merged
balloob merged 1 commit into
home-assistant:devfrom
emontnemery:device_action_config_validation
Oct 2, 2019
Merged

Improve validation of device action config#27029
balloob merged 1 commit into
home-assistant:devfrom
emontnemery:device_action_config_validation

Conversation

@emontnemery
Copy link
Copy Markdown
Contributor

Description:

Improve validation of device action config.
This includes action part from #26830

Improve both when loading at startup, and when an automation is modified through the automation editor UI.

Checklist:

  • The code change is tested and works locally.
  • Local tests pass with tox. Your PR cannot be merged unless tests pass
  • There is no commented out code in this PR.
  • I have followed the [development checklist][dev-checklist]

If the code does not interact with devices:

  • Tests have been added to verify that the new code works.

"""Validate config."""
action_type = _determine_action(config)

if action_type == ACTION_DEVICE_AUTOMATION:
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we validate the other types?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure it's needed, other types are still validated through the action schema. We need to validate ACTION_CONDITION because it might include device conditions. That's coming in a follow up PR.

Copy link
Copy Markdown
Member

@balloob balloob left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok when comment answered

@balloob balloob merged commit 5a1da72 into home-assistant:dev Oct 2, 2019
@lock lock Bot locked and limited conversation to collaborators Oct 3, 2019
@emontnemery emontnemery deleted the device_action_config_validation branch October 3, 2019 16:35
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants