Skip to content
Snippets Groups Projects
Commit 79ad17a7 authored by Antoine Prieels's avatar Antoine Prieels
Browse files

[FIX] hw_drivers: No connected display

In the latest version of Raspbian, when no display is connected to the
HDMI port, "tvservice -n" finds a display named "Unk-Composite dis".
Therefore, the `distant_display` was not created.
parent 43387468
No related branches found
No related tags found
No related merge requests found
......@@ -296,8 +296,8 @@ class Manager(Thread):
def get_connected_displays(self):
display_devices = {}
hdmi = subprocess.check_output(['tvservice', '-n']).decode('utf-8')
if hdmi.find('=') != -1:
hdmi = subprocess.check_output(['tvservice', '-n']).decode('utf-8').replace('\n', '')
if hdmi.find('=') != -1 and hdmi.split('=')[1] != "Unk-Composite dis":
hdmi_serial = sub('[^a-zA-Z0-9 ]+', '', hdmi.split('=')[1]).replace(' ', '_')
iot_device = IoTDevice({
'identifier': hdmi_serial,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment