mirror of
https://github.com/ByteWelder/Tactility.git
synced 2026-02-18 19:03:16 +00:00
Fix
This commit is contained in:
parent
1a81b4a81a
commit
26b4ea360e
@ -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:
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user