Fix path of device tree on HassOS add on (#8764)

* fix device tree path for HassOS

* fix symlink call

* fix formatting
This commit is contained in:
Marc Altmann 2023-11-28 01:13:12 +01:00 committed by GitHub
parent fef6a7ca74
commit 27cf1cdf15
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -42,6 +42,11 @@ class Rknn(DetectionApi):
type_key = DETECTOR_KEY
def __init__(self, config: RknnDetectorConfig):
# create symlink for Home Assistant add on
if not os.path.isfile("/proc/device-tree/compatible"):
if os.path.isfile("/device-tree/compatible"):
os.symlink("/device-tree/compatible", "/proc/device-tree/compatible")
# find out SoC
try:
with open("/proc/device-tree/compatible") as file: