From 501e7c84be21e700ae60424ba648609bcb3eeca2 Mon Sep 17 00:00:00 2001 From: Tomasz Wieczorek Date: Sat, 4 Sep 2021 01:21:18 +0200 Subject: [PATCH] Type scaffold PLATFORMS (#55699) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Added template base type Proposition to add typing, as pre-commit test on newly created integrations fails on it automatically: ``` homeassistant/components//__init__.py:11: error: Need type annotation for "PLATFORMS" (hint: "PLATFORMS: List[] = ...") [var-annotated] Found 1 error in 1 file (checked 4 source files) ``` I believe there shouldn't be other type than text, hence the proposition. * Apply suggestions from code review Co-authored-by: Joakim Sørensen Co-authored-by: Joakim Sørensen --- script/scaffold/templates/config_flow/integration/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/script/scaffold/templates/config_flow/integration/__init__.py b/script/scaffold/templates/config_flow/integration/__init__.py index 2f146dfe6e3..ab5c93364e1 100644 --- a/script/scaffold/templates/config_flow/integration/__init__.py +++ b/script/scaffold/templates/config_flow/integration/__init__.py @@ -8,7 +8,7 @@ from .const import DOMAIN # TODO List the platforms that you want to support. # For your initial PR, limit it to 1 platform. -PLATFORMS = ["light"] +PLATFORMS: list[str] = ["light"] async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool: