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
|
return
|
||||||
|
|
||||||
elif packet._packet_type == packet._NOTIFY:
|
elif packet._packet_type == packet._NOTIFY:
|
||||||
|
log.debug("%s:%i sent us a notification: %s", packet)
|
||||||
if packet.nt == SSDP_ROOT_DEVICE:
|
if packet.nt == SSDP_ROOT_DEVICE:
|
||||||
address, port, path = ADDRESS_REGEX.findall(packet.location)[0]
|
address, port, path = ADDRESS_REGEX.findall(packet.location)[0]
|
||||||
key = None
|
key = None
|
||||||
|
|
|
@ -219,6 +219,7 @@ class UPnP:
|
||||||
service: str = '', man: str = '', interface_name: str = 'default',
|
service: str = '', man: str = '', interface_name: str = 'default',
|
||||||
kwargs: dict = None) -> None:
|
kwargs: dict = None) -> None:
|
||||||
kwargs = kwargs or {}
|
kwargs = kwargs or {}
|
||||||
|
timeout = int(timeout)
|
||||||
try:
|
try:
|
||||||
asyncio.get_running_loop()
|
asyncio.get_running_loop()
|
||||||
except RuntimeError:
|
except RuntimeError:
|
||||||
|
@ -246,7 +247,7 @@ class UPnP:
|
||||||
fut.set_exception(UPnPError("\"%s\" is not a recognized command" % method))
|
fut.set_exception(UPnPError("\"%s\" is not a recognized command" % method))
|
||||||
return
|
return
|
||||||
try:
|
try:
|
||||||
result = await fn(**kwargs)
|
result = await fn(**{k: fn.__annotations__[k](v) for k, v in kwargs.items()})
|
||||||
fut.set_result(result)
|
fut.set_result(result)
|
||||||
except UPnPError as err:
|
except UPnPError as err:
|
||||||
fut.set_exception(err)
|
fut.set_exception(err)
|
||||||
|
|
Loading…
Reference in a new issue