Skip to content

Commit 16fc297

Browse files
authored
Remove more useless manifest truthiness checks in hassfest (#82914)
1 parent 205a2ee commit 16fc297

File tree

3 files changed

+4
-7
lines changed

3 files changed

+4
-7
lines changed

script/hassfest/codeowners.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,7 @@ def generate_and_validate(integrations: dict[str, Integration], config: Config)
4949
for domain in sorted(integrations):
5050
integration = integrations[domain]
5151

52-
if (
53-
not integration.manifest
54-
or integration.manifest.get("integration_type") == "virtual"
55-
):
52+
if integration.integration_type == "virtual":
5653
continue
5754

5855
codeowners = integration.manifest["codeowners"]

script/hassfest/config_flow.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ def _validate_integration(config: Config, integration: Integration) -> None:
1717
config_flow_file = integration.path / "config_flow.py"
1818

1919
if not config_flow_file.is_file():
20-
if (integration.manifest or {}).get("config_flow"):
20+
if integration.manifest.get("config_flow"):
2121
integration.add_error(
2222
"config_flow",
2323
"Config flows need to be defined in the file config_flow.py",
@@ -149,7 +149,7 @@ def _generate_integrations(
149149
primary_domains = {
150150
domain
151151
for domain, integration in integrations.items()
152-
if integration.manifest and domain not in brand_integration_domains
152+
if domain not in brand_integration_domains
153153
}
154154
# Add all brands to the set
155155
primary_domains |= set(brands)

script/hassfest/manifest.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -292,7 +292,7 @@ def validate_version(integration: Integration) -> None:
292292
293293
Will be removed when the version key is no longer optional for custom integrations.
294294
"""
295-
if not (integration.manifest and integration.manifest.get("version")):
295+
if not integration.manifest.get("version"):
296296
integration.add_error("manifest", "No 'version' key in the manifest file.")
297297
return
298298

0 commit comments

Comments
 (0)