This commit is contained in:
Ken Van Hoeylandt 2026-02-08 23:39:06 +01:00
parent 1a81b4a81a
commit 26b4ea360e

View File

@ -63,12 +63,18 @@ def property_to_string(property: DeviceProperty, devices: list[Device]) -> str:
type = property.type type = property.type
if type == "value" or type == "int": if type == "value" or type == "int":
return property.value return property.value
elif type == "boolean": elif type == "boolean" or type == "bool":
return "true" return "true"
elif type == "text": elif type == "text":
return f"\"{property.value}\"" return f"\"{property.value}\""
elif type == "values": elif type == "values":
return "{ " + ",".join(property.value) + " }" value_list = list()
for item in property.value:
if isinstance(item, PropertyValue):
value_list.append(property_to_string(DeviceProperty(name="", type=item.type, value=item.value), devices))
else:
value_list.append(str(item))
return "{ " + ",".join(value_list) + " }"
elif type == "phandle": elif type == "phandle":
return find_phandle(devices, property.value) return find_phandle(devices, property.value)
else: else: