[core] Add type annotations to component Python (#18697)

Co-authored-by: J. Nick Koston <nick@koston.org>
This commit is contained in:
Jesse Hills
2026-08-23 20:50:27 -05:00
committed by GitHub
co-authored by J. Nick Koston
parent d877fb021c
commit de1361ac0e
487 changed files with 1129 additions and 607 deletions
+3 -1
View File
@@ -16,6 +16,8 @@ from esphome.const import (
UNIT_HECTOPASCAL,
UNIT_PERCENT,
)
from esphome.cpp_generator import MockObj
from esphome.types import ConfigType
CODEOWNERS = ["@esphome/core"]
@@ -84,7 +86,7 @@ CONFIG_SCHEMA_BASE = cv.Schema(
).extend(cv.polling_component_schema("60s"))
async def to_code_base(config):
async def to_code_base(config: ConfigType) -> MockObj:
var = cg.new_Pvariable(config[CONF_ID])
await cg.register_component(var, config)