fix add_port_mapping

This commit is contained in:
Jack Robison 2018-10-17 21:07:48 -04:00
parent c83f0af7c8
commit 499bbcc61d
No known key found for this signature in database
GPG key ID: DF25C68FE0239BB2
2 changed files with 5 additions and 8 deletions

View file

@ -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()

View file

@ -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