Skip to content

Commit 86f614b

Browse files
authored
Merge pull request #307 from mmontol/main
Add support for LubanCat-4
2 parents 9687122 + 650590d commit 86f614b

File tree

2 files changed

+17
-2
lines changed

2 files changed

+17
-2
lines changed

adafruit_platformdetect/board.py

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ def __init__(self, detector) -> None:
4242
self.detector = detector
4343
self._board_id = None
4444

45-
# pylint: disable=invalid-name, protected-access, too-many-return-statements
45+
# pylint: disable=invalid-name, protected-access, too-many-return-statements, too-many-lines
4646
@property
4747
def id(self) -> Optional[str]:
4848
"""Return a unique id for the detected board, if any."""
@@ -177,7 +177,12 @@ def id(self) -> Optional[str]:
177177
elif chip_id == chips.RK3568:
178178
board_id = self._rk3568_id()
179179
elif chip_id == chips.RK3588:
180-
board_id = self._rock_pi_id() or self._orange_pi_id() or self._armbian_id()
180+
board_id = (
181+
self._rock_pi_id()
182+
or self._orange_pi_id()
183+
or self._armbian_id()
184+
or self._rk3588_id()
185+
)
181186
elif chip_id == chips.RYZEN_V1605B:
182187
board_id = self._udoo_id()
183188
elif chip_id == chips.PENTIUM_N3710:
@@ -559,6 +564,14 @@ def _rk3568_id(self) -> Optional[str]:
559564
board = boards.ROCK_PI_3A
560565
return board
561566

567+
def _rk3588_id(self) -> Optional[str]:
568+
"""Check what type of rk3588 board."""
569+
board_value = self.detector.get_device_model()
570+
board = None
571+
if board_value and "LubanCat-4" in board_value:
572+
board = boards.LUBANCAT4
573+
return board
574+
562575
def _rock_pi_id(self) -> Optional[str]:
563576
"""Check what type of Rock Pi board."""
564577
board_value = self.detector.get_device_model()

adafruit_platformdetect/constants/boards.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,7 @@
110110
LUBANCAT_ZERO = "LUBANCAT_ZERO"
111111
LUBANCAT1 = "LUBANCAT1"
112112
LUBANCAT2 = "LUBANCAT2"
113+
LUBANCAT4 = "LUBANCAT4"
113114

114115
# Various Raspberry Pi models
115116
RASPBERRY_PI_B_REV1 = "RASPBERRY_PI_B_REV1"
@@ -273,6 +274,7 @@
273274
LUBANCAT_ZERO,
274275
LUBANCAT1,
275276
LUBANCAT2,
277+
LUBANCAT4,
276278
)
277279

278280
# Coral boards

0 commit comments

Comments
 (0)