1
0
mirror of https://github.com/home-assistant/supervisor.git synced 2025-12-24 04:19:03 +00:00

Enable mypy part 1 (addons and api) (#5759)

* Fix mypy issues in addons

* Fix mypy issues in api

* fix docstring

* Brackets instead of get with default
This commit is contained in:
Mike Degatano
2025-03-25 15:06:35 -04:00
committed by GitHub
parent 543d6efec4
commit 0636e49fe2
62 changed files with 500 additions and 382 deletions

View File

@@ -807,7 +807,7 @@ class CoreSysAttributes:
return self.coresys.now()
def sys_run_in_executor(
self, funct: Callable[..., T], *args: tuple[Any], **kwargs: dict[str, Any]
self, funct: Callable[..., T], *args, **kwargs
) -> Coroutine[Any, Any, T]:
"""Add a job to the executor pool."""
return self.coresys.run_in_executor(funct, *args, **kwargs)
@@ -820,8 +820,8 @@ class CoreSysAttributes:
self,
delay: float,
funct: Callable[..., Coroutine[Any, Any, T]],
*args: tuple[Any],
**kwargs: dict[str, Any],
*args,
**kwargs,
) -> asyncio.TimerHandle:
"""Start a task after a delay."""
return self.coresys.call_later(delay, funct, *args, **kwargs)
@@ -830,8 +830,8 @@ class CoreSysAttributes:
self,
when: datetime,
funct: Callable[..., Coroutine[Any, Any, T]],
*args: tuple[Any],
**kwargs: dict[str, Any],
*args,
**kwargs,
) -> asyncio.TimerHandle:
"""Start a task at the specified datetime."""
return self.coresys.call_at(when, funct, *args, **kwargs)