Improve setup_time typing (#66509)

This commit is contained in:
Marc Mueller 2022-02-14 14:24:58 +01:00 committed by GitHub
parent dbd26c7faf
commit b2ee7cebc9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 15 additions and 11 deletions

View file

@ -3,8 +3,9 @@ from __future__ import annotations
import asyncio
from collections.abc import Callable
import datetime as dt
import json
from typing import Any
from typing import Any, cast
import voluptuous as vol
@ -305,7 +306,9 @@ async def handle_integration_setup_info(
msg["id"],
[
{"domain": integration, "seconds": timedelta.total_seconds()}
for integration, timedelta in hass.data[DATA_SETUP_TIME].items()
for integration, timedelta in cast(
dict[str, dt.timedelta], hass.data[DATA_SETUP_TIME]
).items()
],
)