Skip to content

Commit

Permalink
Merge pull request #369 from Rippanda12/main
Browse files Browse the repository at this point in the history
Add Indiedroid Support
  • Loading branch information
FoamyGuy authored Oct 7, 2024
2 parents a6897f7 + 47ce0ad commit 287633c
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
13 changes: 13 additions & 0 deletions adafruit_platformdetect/board.py
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,7 @@ def id(self) -> Optional[str]:
or self._orange_pi_id()
or self._armbian_id()
or self._rk3588_id()
or self._ameridroid_id()
)
elif chip_id == chips.RYZEN_V1605B:
board_id = self._udoo_id()
Expand Down Expand Up @@ -483,6 +484,12 @@ def _diet_pi_id(self) -> Optional[str]:
return boards.ORANGE_PI_4
return None

def _ameridroid_id(self) -> Optional[str]:
board_value = self.detector.get_device_model().upper()
if "INDIEDROID NOVA" in board_value:
return boards.INDIEDROID_NOVA
return None

def _orange_pi_id(self) -> Optional[str]:
board_value = self.detector.get_device_model()
if "Orange Pi 5 Plus" in board_value:
Expand Down Expand Up @@ -942,6 +949,11 @@ def any_beaglebone(self) -> bool:
"""Check whether the current board is any Beaglebone-family system."""
return self.id in boards._BEAGLEBONE_IDS

@property
def any_ameridroid(self) -> bool:
"""Check whether the current board is any Ameridroid device."""
return self.id in boards._AMERIDROID_IDS

@property
def any_orange_pi(self) -> bool:
"""Check whether the current board is any defined Orange Pi."""
Expand Down Expand Up @@ -1130,6 +1142,7 @@ def lazily_generate_conditions():
yield self.any_raspberry_pi_40_pin
yield self.any_raspberry_pi
yield self.any_beaglebone
yield self.any_ameridroid
yield self.any_orange_pi
yield self.any_nanopi
yield self.any_giant_board
Expand Down
5 changes: 5 additions & 0 deletions adafruit_platformdetect/constants/boards.py
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,9 @@
LUCKFOX_PICO_MINI = "LUCKFOX_PICO_MINI"
LUCKFOX_PICO_PLUS = "LUCKFOX_PICO_PLUS"

# Ameridroid boards
INDIEDROID_NOVA = "INDIEDROID_NOVA"

# StarFive boards
_STARFIVE_BOARD_IDS = (VISIONFIVE2,)
# Asus Tinkerboard
Expand Down Expand Up @@ -626,5 +629,7 @@
LUCKFOX_PICO_PLUS,
)

_AMERIDROID_IDS = (INDIEDROID_NOVA,)

# Agnostic board
OS_AGNOSTIC_BOARD = "OS_AGNOSTIC_BOARD"

0 comments on commit 287633c

Please sign in to comment.