Add setup type hints to all template platforms (#63295)
Co-authored-by: epenet <epenet@users.noreply.github.com>
This commit is contained in:
parent
94061fa997
commit
1c30992b0e
7 changed files with 73 additions and 12 deletions
|
@ -35,6 +35,8 @@ from homeassistant.core import HomeAssistant, callback
|
|||
from homeassistant.exceptions import TemplateError
|
||||
from homeassistant.helpers import config_validation as cv, template
|
||||
from homeassistant.helpers.entity import async_generate_entity_id
|
||||
from homeassistant.helpers.entity_platform import AddEntitiesCallback
|
||||
from homeassistant.helpers.typing import ConfigType, DiscoveryInfoType
|
||||
|
||||
from .const import (
|
||||
CONF_ATTRIBUTE_TEMPLATES,
|
||||
|
@ -156,7 +158,12 @@ def _async_create_template_tracking_entities(
|
|||
async_add_entities(sensors)
|
||||
|
||||
|
||||
async def async_setup_platform(hass, config, async_add_entities, discovery_info=None):
|
||||
async def async_setup_platform(
|
||||
hass: HomeAssistant,
|
||||
config: ConfigType,
|
||||
async_add_entities: AddEntitiesCallback,
|
||||
discovery_info: DiscoveryInfoType | None = None,
|
||||
) -> None:
|
||||
"""Set up the template sensors."""
|
||||
if discovery_info is None:
|
||||
_async_create_template_tracking_entities(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue