Skip to content

Commit 90cf194

Browse files
committed
fixed partials
1 parent 5b9c915 commit 90cf194

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

appdaemon/utils.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -541,7 +541,7 @@ async def run_in_executor(self: Subsystem, fn: Callable[..., R], *args, **kwargs
541541
Returns:
542542
Whatever the function returns
543543
"""
544-
function_name = fn.__qualname__
544+
function_name = unwrapped(fn).__qualname__
545545
executor_name = type(self.AD.executor).__name__
546546
self.AD.threading.logger.debug(f"Running {function_name} in the {executor_name}")
547547

@@ -1073,6 +1073,8 @@ def make_endpoint(base: str, endpoint: str) -> str:
10731073
def unwrapped(func: Callable) -> Callable:
10741074
while hasattr(func, "__wrapped__"):
10751075
func = func.__wrapped__
1076+
if isinstance(func, functools.partial):
1077+
func = func.func
10761078
return func
10771079

10781080

0 commit comments

Comments
 (0)