Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 10 additions & 4 deletions adafruit_platformdetect/chip.py
Original file line number Diff line number Diff line change
Expand Up @@ -363,6 +363,9 @@ def _linux_id(self) -> Optional[str]:
if self.detector.check_dt_compatible_value("particle,tachyon"):
return chips.QCM6490

if self.detector.check_dt_compatible_value("brcm,bcm2"):
return chips.BCM2XXX

linux_id = None
hardware = self.detector.get_cpuinfo_field("Hardware")

Expand Down Expand Up @@ -446,9 +449,12 @@ def _linux_id(self) -> Optional[str]:
# convert it to a list and let the remaining
# conditions attempt.
if not linux_id:
hardware = [
entry.replace("\x00", "") for entry in compatible.split(",")
]
if compatible:
hardware = [
entry.replace("\x00", "") for entry in compatible.split(",")
]
else:
hardware = []

if not linux_id:
if "AM33XX" in hardware:
Expand Down Expand Up @@ -499,7 +505,7 @@ def __getattr__(self, attr: str) -> bool:
list of constants at the top of this module for available options.
"""
if attr == "id":
raise AttributeError() # Avoid infinite recursion
raise AttributeError("id") # Avoid infinite recursion
if self.id == attr:
return True
return False
Loading