wireless.py: Refactor

This commit is contained in:
Mykola Grymalyuk
2022-11-13 16:21:46 -07:00
parent 235a9985f4
commit b448a4b6dd
2 changed files with 85 additions and 64 deletions
+3
View File
@@ -10,6 +10,7 @@ class build_wired:
self.config = config
self.computer = self.constants.computer
def build(self):
# Check if Ethernet was detected, otherwise fall back to assumptions (mainly for 2011 MacBook Airs and TB Ethernet)
if not self.constants.custom_model and self.constants.computer.ethernet:
@@ -17,6 +18,7 @@ class build_wired:
else:
self.prebuilt_assumption()
def on_model(self):
# On-model hardware detection
for controller in self.constants.computer.ethernet:
@@ -44,6 +46,7 @@ class build_wired:
elif isinstance(controller, device_probe.Marvell) or isinstance(controller, device_probe.SysKonnect):
support.build_support(self.model, self.constants, self.config).enable_kext("MarvelYukonEthernet.kext", self.constants.marvel_version, self.constants.marvel_path)
def prebuilt_assumption(self):
# Stock hardware assumptions
if not self.model in smbios_data.smbios_dictionary: