Python package that allows to manage tenda router AC15.
Project description
tenda-wifi
A simple Python package that allows to manage tenda router AC15.
Installation
$ pip install tendawifi
API
First of all, it has to instance a TendaAC15 object:
If it run with default router ip "192.168.1.1":
>>> t = tendawifi.TendaAC15()
>>> Pass:
If it run with custom router ip:
>>> t = tendawifi.TendaAC15(url_base="10.0.0.1")
>>> Pass:
If it run without asking the password:
>>> t = tendawifi.TendaAC15(url_base="10.0.0.1", password="YOURPASS")
Currently, it has the following features:
Get Parent Control configuration by MAC address
def get_parent_control(self, mac: str) -> dict:
"""
Return a dictionary of a Client Parent Control configuration.
Args:
mac:str: Client MAC address ex: "aa:bb:cc:dd:ee:ff"
Returns:
dict: {'enable': 1, 'mac': 'aa:bb:cc:dd:ee:ff', 'url_enable': 0, 'urls': '',
'time': '09:00-01:30', 'day': '1,1,1,1,1,1,1', 'limit_type': 1}
"""
Set Parent Control configuration MAC address
def set_parent_control(self, mac: str, status: int) -> str:
"""
Set status of a Client Parent Control configuration.
Args:
mac:str: Client MAC address ex: "aa:bb:cc:dd:ee:ff"
status:int: Status of client Parent Control ex: 1 (enable) 0 (disable)
Returns:
str: Request response '{"errCode":0}'
"""
Get Virtual Server configuration
def get_vports(self) -> dict:
"""
Return a dictionary of Virtual Server configuration.
Returns:
dict: {'lanIp': '192.168.1.1', 'lanMask': '255.255.255.0',
'virtualList': [{'ip': '192.168.1.100', 'inPort': '80', 'outPort': '80', 'protocol': '0'}, ...]}
"""
Set Virtual Server configuration
def set_vports(self, vports_dict: dict) -> str:
"""
Set Virtual Server configuration from dictionary returned by get_vports() method.
Args:
vports_dict:list: List of Virtual Server settings.
Returns:
str: Request response '{"errCode":0}'
"""
Get Bandwidth Control configuration
def get_net_control(self) -> list:
"""
Return a list of Bandwidth configuration.
Returns:
list: [{'netControlEn': '1'}, {'upSpeed': '0', 'downSpeed': '0', 'devType': 'unknown',
'hostName': 'ClientName', 'ip': '192.168.1.100', 'mac': 'aa:bb:cc:dd:ee:ff', 'limitUp': '0',
'limitDown': '0', 'isControled': '0', 'offline': '0', 'isSet': '0'}, ...]
"""
Set Bandwidth Control configuration
def set_net_control(self, net_control: list) -> str:
"""
Set Bandwidth Control configuration from list returned by get_net_control() method.
Args:
net_control:list: List of Bandwidth settings.
Returns:
str: Request response '{"errCode":0}'
"""
Get DHCP Reservation configuration by MAC address
def get_ipmac_bind(self) -> dict:
"""
Return a dictionary of DHCP Reservation configuration.
Returns:
dict: {'lanIp': '192.168.1.1', 'lanMask': '255.255.255.0', 'dhttpIP': '172.27.175.218', 'dhcpClientList': [],
'bindList': [{'ipaddr': '192.168.1.100', 'macaddr': 'aa:bb:cc:dd:ee:ff', 'devname': 'ClientName', 'status': '1'}, ...]}
"""
Set DHCP Reservation configuration by MAC address
def set_ipmac_bind(self, ipmac_bind_dict: dict) -> str:
"""
Set DHCP Reservation configuration from dictionary returned by get_ipmac_bind() method.
Args:
ipmac_bind_dict:dict: List of DHCP Reservation settings.
Returns:
str: Request response '{"errCode":0}'
"""
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
tendawifi-0.0.2.tar.gz
(4.0 kB
view hashes)
Built Distribution
Close
Hashes for tendawifi-0.0.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9656d7b1194afe002cdad4ff6a58c25f00b7611440746b9028f04e4f7f072ec6 |
|
MD5 | e1e5ebe46c1a91d75e25a85356e450f5 |
|
BLAKE2b-256 | 8aff571816cb9ece1a38560eeae3efc48c9187de308c5d86f63f053c47e4f5a2 |