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:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user