Skip to content

Commit ab2bd7d

Browse files
author
Dale Weber
committed
Changed names of UDOO_IDS and UDOO_ASSET_TAG; Corrected layout of UDOO_BOARD_IDS
1 parent d3cc2a2 commit ab2bd7d

File tree

3 files changed

+17
-4
lines changed

3 files changed

+17
-4
lines changed

adafruit_platformdetect/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ def check_board_asset_tag_value(self):
127127

128128
try:
129129
with open("/sys/devices/virtual/dmi/id/board_asset_tag", "r") as tag_file:
130-
tag = tag_file.read()
130+
tag = tag_file.read().strip()
131131
except FileNotFoundError:
132132
pass
133133

adafruit_platformdetect/board.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ def id(self):
118118
board_id = self._clockwork_pi_id()
119119
elif chip_id == chips.RK3308:
120120
board_id = self._rock_pi_id()
121-
elif self.board_asset_tag == "SC40-2000-0000-C0|C":
121+
elif self.board_asset_tag == boards._UDOO_BOLT_BOARD_ASSET_TAG
122122
board_id = boards.UDOO_BOLT
123123

124124
return board_id
@@ -395,6 +395,11 @@ def any_clockwork_pi_board(self):
395395
"""Check whether the current board is any Clockwork Pi device."""
396396
return self.CLOCKWORK_CPI3
397397

398+
@property
399+
def any_udoo_board(self):
400+
"""Check to see if the current board is an UDOO board"""
401+
return self.id in boards._UDOO_BOARD_IDS
402+
398403
@property
399404
def any_embedded_linux(self):
400405
"""Check whether the current board is any embedded Linux device."""
@@ -414,6 +419,7 @@ def any_embedded_linux(self):
414419
self.any_pynq_board,
415420
self.any_rock_pi_board,
416421
self.any_clockwork_pi_board,
422+
self.any_udoo_board,
417423
]
418424
)
419425

adafruit_platformdetect/constants/boards.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,8 +95,6 @@
9595

9696
GREATFET_ONE = "GREATFET_ONE"
9797

98-
UDOO_BOLT = "UDOO_BOLT"
99-
10098
# pylint: enable=bad-whitespace
10199

102100
# OrangePI
@@ -336,3 +334,12 @@
336334

337335
# Pine64 boards and devices
338336
_PINE64_DEV_IDS = (PINE64, PINEBOOK, PINEPHONE)
337+
338+
UDOO_BOLT = "UDOO_BOLT"
339+
_UDOO_BOLT_BOARD_ASSET_TAG = "SC40-2000-0000-C0|C"
340+
341+
# UDOO
342+
_UDOO_BOARD_IDS = (
343+
UDOO_BOLT,
344+
_UDOO_BOLT_BOARD_ASSET_TAG,
345+
)

0 commit comments

Comments
 (0)