Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 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
6 changes: 6 additions & 0 deletions adafruit_platformdetect/board.py
Original file line number Diff line number Diff line change
Expand Up @@ -448,6 +448,8 @@
board = boards.ORANGE_PI_5_PLUS
elif board_value == "orangepi5":
board = boards.ORANGE_PI_5
elif board_value == "orangepi5-pro":
board = boards.ORANGE_PI_5_PRO
elif board_value == "bananapim2zero":
board = boards.BANANA_PI_M2_ZERO
elif board_value == "bananapim2plus":
Expand Down Expand Up @@ -514,10 +516,12 @@
return boards.INDIEDROID_NOVA
return None

def _orange_pi_id(self) -> Optional[str]:

Check failure on line 519 in adafruit_platformdetect/board.py

View workflow job for this annotation

GitHub Actions / test

Too many return statements (7/6)
board_value = self.detector.get_device_model()
if "OPi 5 Max" in board_value:
return boards.ORANGE_PI_5_MAX
if "OPi 5 Pro" in board_value:
return boards.ORANGE_PI_5_PRO
if "Orange Pi 5 Max" in board_value:
return boards.ORANGE_PI_5_MAX
if "Orange Pi 5 Plus" in board_value:
Expand All @@ -528,6 +532,8 @@
return boards.ORANGE_PI_3B
return None

# pylint: enable=too-many-return-statements

def _sama5_id(self) -> Optional[str]:
"""Check what type sama5 board."""
board_value = self.detector.get_device_model()
Expand Down
2 changes: 2 additions & 0 deletions adafruit_platformdetect/constants/boards.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# SPDX-FileCopyrightText: 2021 Melissa LeBlanc-Williams for Adafruit Industries
#
# SPDX-License-Identifier: MIT
Expand Down Expand Up @@ -69,6 +69,7 @@
ORANGE_PI_5 = "ORANGE_PI_5"
ORANGE_PI_5_MAX = "ORANGE_PI_5_MAX"
ORANGE_PI_5_PLUS = "ORANGE_PI_5_PLUS"
ORANGE_PI_5_PRO = "ORANGE_PI_5_PRO"

# Nano Pi boards
NANOPI_NEO_AIR = "NANOPI_NEO_AIR"
Expand Down Expand Up @@ -314,6 +315,7 @@
ORANGE_PI_4_LTS,
ORANGE_PI_5,
ORANGE_PI_5_PLUS,
ORANGE_PI_5_PRO
)

# NanoPi
Expand Down
Loading