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