From 499bbcc61d0ab512078870d0f4d59f491e91ead9 Mon Sep 17 00:00:00 2001 From: Jack Robison Date: Wed, 17 Oct 2018 21:07:48 -0400 Subject: [PATCH] fix add_port_mapping --- aioupnp/commands.py | 7 ++----- aioupnp/upnp.py | 6 +++--- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/aioupnp/commands.py b/aioupnp/commands.py index 3e34722..bfe44a1 100644 --- a/aioupnp/commands.py +++ b/aioupnp/commands.py @@ -4,13 +4,10 @@ none_or_str = Union[None, str] class SOAPCommands: - def debug_commands(self) -> dict: - raise NotImplementedError() - @staticmethod async def AddPortMapping(NewRemoteHost: str, NewExternalPort: int, NewProtocol: str, NewInternalPort: int, - NewInternalClient: str, NewEnabled: bool, NewPortMappingDescription: str, - NewLeaseDuration: str = '') -> None: + NewInternalClient: str, NewEnabled: int, NewPortMappingDescription: str, + NewLeaseDuration: str = '0') -> None: """Returns None""" raise NotImplementedError() diff --git a/aioupnp/upnp.py b/aioupnp/upnp.py index f7703d7..0334f5a 100644 --- a/aioupnp/upnp.py +++ b/aioupnp/upnp.py @@ -85,11 +85,11 @@ class UPnP: @cli async def add_port_mapping(self, external_port: int, protocol: str, internal_port: int, lan_address: str, - description: str, lease_duration: int) -> None: + description: str) -> None: return await self.gateway.commands.AddPortMapping( - NewRemoteHost="", NewExternalPort=external_port, NewProtocol=protocol, + NewRemoteHost='', NewExternalPort=external_port, NewProtocol=protocol, NewInternalPort=internal_port, NewInternalClient=lan_address, - NewEnabled=True, NewPortMappingDescription=description, NewLeaseDuration=str(lease_duration) + NewEnabled=1, NewPortMappingDescription=description ) @cli