Tested on MC888:
When the switch is selected, the data goes offline automatically (you don't have to create an automation for it, so its indeed a better solution than the webpage where you need to disconnect manually before changing data mode). Then the data status is changed and data mode is activated for reconnection automatically.
I just programmed the "5G NSA" (called LTE AND 5G) and "5G SA" (called 5G only) switches. I will add the other switches too, but maybe uncommented.
I will create a push in the next days, but here again: I don't know if these commands work on the other models.
added to mc.py:
def setdata_5G_SA(self):
cookie = self.getCookie(password=self.password, LD=self.get_LD())
AD = self.get_AD()
header = {"Referer": self.referer, "Cookie": cookie}
payload = f'isTest=false&goformId=Only_5G&AD=' + AD
payload = f'isTest=false&goformId=SET_BEARER_PREFERENCE&BearerPreference=Only_5G&AD=' + AD
print(payload)
r = s.post(self.referer + "goform/goform_set_cmd_process", headers=header, data=payload, verify=False)
return r.status_code
def setdata_5G_NSA(self):
cookie = self.getCookie(password=self.password, LD=self.get_LD())
AD = self.get_AD()
header = {"Referer": self.referer, "Cookie": cookie}
payload = f'isTest=false&goformId=SET_BEARER_PREFERENCE&BearerPreference=LTE_AND_5G&AD=' + AD
print(payload)
r = s.post(self.referer + "goform/goform_set_cmd_process", headers=header, data=payload, verify=False)
return r.status_code
Tested on MC888: When the switch is selected, the data goes offline automatically (you don't have to create an automation for it, so its indeed a better solution than the webpage where you need to disconnect manually before changing data mode). Then the data status is changed and data mode is activated for reconnection automatically.
I just programmed the "5G NSA" (called LTE AND 5G) and "5G SA" (called 5G only) switches. I will add the other switches too, but maybe uncommented.
I will create a push in the next days, but here again: I don't know if these commands work on the other models.
added to mc.py:
edited in switch.py:
Will rewrite this to use a input_select entidy