From c3dd37f105ac621322b63f3348309e8aa37eb5b0 Mon Sep 17 00:00:00 2001 From: Jannik Schönartz Date: Tue, 29 Jun 2021 15:49:24 +0200 Subject: [bas-hw-collect] Change edid from list to object with the connectionports as keys --- modules.d/bas-hw-collect/scripts/collect_hw_info_json.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/modules.d/bas-hw-collect/scripts/collect_hw_info_json.py b/modules.d/bas-hw-collect/scripts/collect_hw_info_json.py index f9d6994e..8e2913fd 100755 --- a/modules.d/bas-hw-collect/scripts/collect_hw_info_json.py +++ b/modules.d/bas-hw-collect/scripts/collect_hw_info_json.py @@ -187,7 +187,7 @@ def get_net_fallback(): # Get and convert EDID data to hex def get_edid(): - edid = [] + edid = {} display_paths = run_subprocess('ls /sys/class/drm/*/edid') if display_paths: display_paths = display_paths.split('\n') @@ -197,7 +197,8 @@ def get_edid(): if dp == '': continue edid_hex = open(dp, 'rb').read().hex() if len(edid_hex) > 0: - edid.append({ 'path': dp, 'edid': edid_hex }) + # The path is always /sys/class/drm/[..]/edid, so cut the first 15 chars and the last 5 chars + edid[dp[15:-5]] = edid_hex return edid def get_lshw(): -- cgit v1.2.3-55-g7522