mirror of
https://github.com/openwrt-xiaomi/xmir-patcher.git
synced 2026-09-22 22:57:55 +03:00
Always using uppercase device name
This commit is contained in:
+5
-5
@@ -31,15 +31,15 @@ if gw.status < 1:
|
||||
|
||||
dn = gw.device_name
|
||||
|
||||
if dn == 'r2100' or dn == 'r2350' or dn == 'rm1800' or dn == 'rm2100' or dn == 'ra67':
|
||||
if dn == 'R2100' or dn == 'R2350' or dn == 'RM1800' or dn == 'RM2100' or dn == 'RA67':
|
||||
import connect2
|
||||
sys.exit(0)
|
||||
|
||||
if dn == 'r3600' and gw.rom_version == '1.0.17':
|
||||
if dn == 'R3600' and gw.rom_version == '1.0.17':
|
||||
import connect2
|
||||
sys.exit(0)
|
||||
|
||||
if dn == 'r3600' or dn == 'rb03':
|
||||
if dn == 'R3600' or dn == 'RB03':
|
||||
import connect3
|
||||
sys.exit(0)
|
||||
|
||||
@@ -73,9 +73,9 @@ fn_pf2 = dn_tmp + fn_pfname + '_02'
|
||||
fn_pf3 = dn_tmp + fn_pfname + '_03'
|
||||
|
||||
fn_suffix = '_mips'
|
||||
if dn == 'r3d' or dn == 'd01':
|
||||
if dn == 'R3D' or dn == 'D01':
|
||||
fn_suffix = '_armv7a'
|
||||
if dn == "rb03":
|
||||
if dn == "RB03":
|
||||
fn_suffix = '_arm64'
|
||||
|
||||
fn_pf = dn_dir + fn_pfname + fn_suffix
|
||||
|
||||
+1
-1
@@ -103,7 +103,7 @@ class Gateway():
|
||||
hardware = re.findall(r'hardwareVersion: \'(.*?)\'', r0.text)
|
||||
if hardware and len(hardware) > 0:
|
||||
self.device_name = hardware[0]
|
||||
self.device_name = self.device_name.lower()
|
||||
self.device_name = self.device_name.upper()
|
||||
romver = re.search(r'romVersion: \'(.*?)\'', r0.text)
|
||||
self.rom_version = romver.group(1).strip() if romver else None
|
||||
romchan = re.search(r'romChannel: \'(.*?)\'', r0.text)
|
||||
|
||||
+2
-2
@@ -17,7 +17,7 @@ bl_name = bl_name.strip().lower()
|
||||
|
||||
|
||||
gw = gateway.Gateway()
|
||||
dname = gw.device_name
|
||||
dn = gw.device_name
|
||||
if not gw.device_name:
|
||||
die("Xiaomi Mi Wi-Fi device not found! (IP: {})".format(gateway.ip_addr))
|
||||
|
||||
@@ -26,7 +26,7 @@ fn_remote = '/tmp/bootloader.bin'
|
||||
fn_local = None
|
||||
|
||||
if bl_name == 'breed':
|
||||
if dname != 'r3g' and dname != 'r3p' and dname != 'rm2100':
|
||||
if dn != 'R3G' and dn != 'R3P' and dn != 'RM2100':
|
||||
die("Breed bootloader cannot be installed on this device!")
|
||||
fn_local = fn_dir + 'breed_r3g_eng.bin'
|
||||
|
||||
|
||||
Reference in New Issue
Block a user