Remove hassfest blacklisted rest (#32441)

* Remove blacklisted deps from hassfest deps

* Whitelist all internal integrations
This commit is contained in:
Paulus Schoutsen 2020-03-03 13:57:09 -08:00 committed by GitHub
parent fed23030d6
commit db7d0eb9b9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 41 additions and 23 deletions

View File

@ -4,5 +4,6 @@
"documentation": "https://www.home-assistant.io/integrations/dwd_weather_warnings", "documentation": "https://www.home-assistant.io/integrations/dwd_weather_warnings",
"requirements": [], "requirements": [],
"dependencies": [], "dependencies": [],
"after_dependencies": ["rest"],
"codeowners": [] "codeowners": []
} }

View File

@ -4,6 +4,7 @@
"documentation": "https://www.home-assistant.io/integrations/emulated_hue", "documentation": "https://www.home-assistant.io/integrations/emulated_hue",
"requirements": ["aiohttp_cors==0.7.0"], "requirements": ["aiohttp_cors==0.7.0"],
"dependencies": [], "dependencies": [],
"after_dependencies": ["http"],
"codeowners": [], "codeowners": [],
"quality_scale": "internal" "quality_scale": "internal"
} }

View File

@ -65,7 +65,7 @@ class ImportCollector(ast.NodeVisitor):
# self.hass.components.hue.async_create() # self.hass.components.hue.async_create()
# Name(id=self) # Name(id=self)
# .Attribute(attr=hass) # .Attribute(attr=hass) or .Attribute(attr=_hass)
# .Attribute(attr=hue) # .Attribute(attr=hue)
# .Attribute(attr=async_create) # .Attribute(attr=async_create)
if ( if (
@ -78,7 +78,7 @@ class ImportCollector(ast.NodeVisitor):
) )
or ( or (
isinstance(node.value.value, ast.Attribute) isinstance(node.value.value, ast.Attribute)
and node.value.value.attr == "hass" and node.value.value.attr in ("hass", "_hass")
) )
) )
): ):
@ -89,20 +89,47 @@ class ImportCollector(ast.NodeVisitor):
ALLOWED_USED_COMPONENTS = { ALLOWED_USED_COMPONENTS = {
# This component will always be set up # Internal integrations
"persistent_notification", "alert",
# These allow to register things without being set up
"conversation",
"frontend",
"hassio",
"system_health",
"websocket_api",
"automation", "automation",
"conversation",
"device_automation", "device_automation",
"zone", "frontend",
"group",
"hassio",
"homeassistant", "homeassistant",
"system_log", "input_boolean",
"input_datetime",
"input_number",
"input_select",
"input_text",
"persistent_notification",
"person", "person",
"script",
"shopping_list",
"sun",
"system_health",
"system_log",
"timer",
"webhook",
"websocket_api",
"zone",
# Entity integrations with platforms
"alarm_control_panel",
"binary_sensor",
"climate",
"cover",
"device_tracker",
"fan",
"image_processing",
"light",
"lock",
"media_player",
"scene",
"sensor",
"switch",
"vacuum",
"water_heater",
# Other # Other
"mjpeg", # base class, has no reqs or component to load. "mjpeg", # base class, has no reqs or component to load.
"stream", # Stream cannot install on all systems, can be imported without reqs. "stream", # Stream cannot install on all systems, can be imported without reqs.
@ -121,18 +148,7 @@ IGNORE_VIOLATIONS = {
# This should become a helper method that integrations can submit data to # This should become a helper method that integrations can submit data to
("websocket_api", "lovelace"), ("websocket_api", "lovelace"),
("websocket_api", "shopping_list"), ("websocket_api", "shopping_list"),
# Expose HA to external systems
"homekit",
"alexa",
"google_assistant",
"emulated_hue",
"prometheus",
"conversation",
"logbook", "logbook",
"mobile_app",
# These should be extracted to external package
"pvoutput",
"dwd_weather_warnings",
} }