Files
sagemcom/fix_admz.py
T
2023-03-05 22:30:59 -03:30

20 lines
674 B
Python
Executable File

#!/usr/bin/python3
import asyncio
from sagemcom_api.client import SagemcomClient
from config_modem import *
async def main() -> None:
async with await modem() as client:
try:
await client.login()
except Exception as exception: # pylint: disable=broad-except
print(exception)
return
await client.set_value_by_xpath('Device/Services/BellNetworkCfg/AdvancedDMZ/Enable', False)
await client.set_value_by_xpath('Device/Services/BellNetworkCfg/AdvancedDMZ/AdvancedDMZhost', ADMZ_MAC)
await client.set_value_by_xpath('Device/Services/BellNetworkCfg/AdvancedDMZ/Enable', True)
asyncio.run(main())