Skip to content

Commit 3ba1457

Browse files
authored
Fix requires_feature decorator checking with named arguments (#22)
Fix requires_feature annotation with named arguments
1 parent 28427b8 commit 3ba1457

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

letpot/deviceclient.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ def decorator(
5151
@wraps(func)
5252
async def wrapper(*args: P.args, **kwargs: P.kwargs) -> _R:
5353
self = cast(LetPotDeviceClient, args[0])
54-
serial = cast(str, args[1])
54+
serial = cast(str, args[1] if len(args) >= 2 else kwargs["serial"])
5555
exception_message = f"Device missing required feature: {required_feature}"
5656
try:
5757
supported_features = self._converter(serial).supported_features()

0 commit comments

Comments
 (0)