Skip to content

Commit

Permalink
Do load load manifest during validation (#3275)
Browse files Browse the repository at this point in the history
  • Loading branch information
ludeeus authored Sep 26, 2023
1 parent 98eeb42 commit e92989a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions custom_components/hacs/validate/hacsjson.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from voluptuous.error import Invalid

from ..enums import HacsCategory, RepositoryFile
from ..repositories.base import HacsManifest, HacsRepository
from ..repositories.base import HacsRepository
from ..utils.validate import HACS_MANIFEST_JSON_SCHEMA
from .base import ActionValidationBase, ValidationException

Expand All @@ -25,10 +25,10 @@ async def async_validate(self):

content = await self.repository.async_get_hacs_json(self.repository.ref)
try:
hacsjson = HacsManifest.from_dict(HACS_MANIFEST_JSON_SCHEMA(content))
HACS_MANIFEST_JSON_SCHEMA(content)
except Invalid as exception:
raise ValidationException(exception) from exception

if self.repository.data.category == HacsCategory.INTEGRATION:
if hacsjson.zip_release and not hacsjson.filename:
if content.get("zip_release") and not content.get("filename"):
raise ValidationException("zip_release is True, but filename is not set")

0 comments on commit e92989a

Please sign in to comment.