Throw error in hassfest when integration is missing version (#45976)

This commit is contained in:
Joakim Sørensen 2021-02-04 13:31:17 +01:00 committed by GitHub
parent 9c6c2a77ab
commit 1a74709757
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View file

@ -119,7 +119,7 @@ def validate_version(integration: Integration):
Will be removed when the version key is no longer optional for custom integrations.
"""
if not integration.manifest.get("version"):
integration.add_warning(
integration.add_error(
"manifest",
"No 'version' key in the manifest file. This will cause a future version of Home Assistant to block this integration.",
)

View file

@ -27,7 +27,7 @@ def test_validate_version_no_key(integration: Integration):
validate_version(integration)
assert (
"No 'version' key in the manifest file. This will cause a future version of Home Assistant to block this integration."
in [x.error for x in integration.warnings]
in [x.error for x in integration.errors]
)