fix cli arg types
This commit is contained in:
parent
7257947700
commit
040faedbf9
2 changed files with 3 additions and 1 deletions
|
@ -82,6 +82,7 @@ class SSDPProtocol(MulticastProtocol):
|
|||
return
|
||||
|
||||
elif packet._packet_type == packet._NOTIFY:
|
||||
log.debug("%s:%i sent us a notification: %s", packet)
|
||||
if packet.nt == SSDP_ROOT_DEVICE:
|
||||
address, port, path = ADDRESS_REGEX.findall(packet.location)[0]
|
||||
key = None
|
||||
|
|
|
@ -219,6 +219,7 @@ class UPnP:
|
|||
service: str = '', man: str = '', interface_name: str = 'default',
|
||||
kwargs: dict = None) -> None:
|
||||
kwargs = kwargs or {}
|
||||
timeout = int(timeout)
|
||||
try:
|
||||
asyncio.get_running_loop()
|
||||
except RuntimeError:
|
||||
|
@ -246,7 +247,7 @@ class UPnP:
|
|||
fut.set_exception(UPnPError("\"%s\" is not a recognized command" % method))
|
||||
return
|
||||
try:
|
||||
result = await fn(**kwargs)
|
||||
result = await fn(**{k: fn.__annotations__[k](v) for k, v in kwargs.items()})
|
||||
fut.set_result(result)
|
||||
except UPnPError as err:
|
||||
fut.set_exception(err)
|
||||
|
|
Loading…
Reference in a new issue