1
0
mirror of https://github.com/home-assistant/core.git synced 2025-12-24 12:59:34 +00:00

Move Platform StrEnum to const (#60857)

This commit is contained in:
Franck Nijhof
2021-12-02 22:30:52 +01:00
committed by GitHub
parent fd8e7ae5d9
commit 6e220d5d17
6 changed files with 44 additions and 73 deletions

View File

@@ -4,8 +4,8 @@ from __future__ import annotations
import ast
from pathlib import Path
from homeassistant.const import Platform
from homeassistant.requirements import DISCOVERY_INTEGRATIONS
from homeassistant.setup import BASE_PLATFORMS
from .model import Integration
@@ -91,12 +91,11 @@ class ImportCollector(ast.NodeVisitor):
ALLOWED_USED_COMPONENTS = {
*{platform.value for platform in Platform},
# Internal integrations
"alert",
"automation",
"button",
"conversation",
"button",
"device_automation",
"frontend",
"group",
@@ -119,8 +118,6 @@ ALLOWED_USED_COMPONENTS = {
"webhook",
"websocket_api",
"zone",
# Entity integrations with platforms
*BASE_PLATFORMS,
# Other
"mjpeg", # base class, has no reqs or component to load.
"stream", # Stream cannot install on all systems, can be imported without reqs.