Skip to content
Snippets Groups Projects
Commit 4869c69a authored by David Hammer's avatar David Hammer
Browse files

Fix: allow assembler scene without geometry (GH2)

parent cf5eece4
No related branches found
No related tags found
No related merge requests found
...@@ -342,7 +342,7 @@ class CompactDeviceLinkList(VerticalLayout): ...@@ -342,7 +342,7 @@ class CompactDeviceLinkList(VerticalLayout):
@titled("Assembler status", width=8 * NARROW_INC) @titled("Assembler status", width=8 * NARROW_INC)
@boxed @boxed
class AssemblerDeviceStatus(VerticalLayout): class AssemblerDeviceStatus(VerticalLayout):
def __init__(self, device_id, geometry_device_id): def __init__(self, device_id, geometry_device_id=None):
super().__init__(padding=0) super().__init__(padding=0)
name = DisplayLabelModel( name = DisplayLabelModel(
keys=[f"{device_id}.deviceId"], keys=[f"{device_id}.deviceId"],
...@@ -391,36 +391,41 @@ class AssemblerDeviceStatus(VerticalLayout): ...@@ -391,36 +391,41 @@ class AssemblerDeviceStatus(VerticalLayout):
width=14 * BASE_INC, width=14 * BASE_INC,
height=BASE_INC, height=BASE_INC,
), ),
LabelModel( ]
text="My geometry device:", )
width=14 * BASE_INC, if geometry_device_id:
height=BASE_INC, self.children.extend(
), [
# note: link based on current value when generating
DeviceSceneLinkModel(
text=geometry_device_id,
keys=[f"{geometry_device_id}.availableScenes"],
target="overview",
target_window=SceneTargetWindow.Dialog,
width=14 * BASE_INC,
height=BASE_INC,
),
HorizontalLayout(
LabelModel( LabelModel(
text="My geometry:", text="My geometry device:",
width=7 * BASE_INC, width=14 * BASE_INC,
height=BASE_INC, height=BASE_INC,
), ),
DisplayStateColorModel( # note: link based on current value when generating
show_string=True, DeviceSceneLinkModel(
keys=[f"{device_id}.geometryState"], text=geometry_device_id,
width=7 * BASE_INC, keys=[f"{geometry_device_id}.availableScenes"],
target="overview",
target_window=SceneTargetWindow.Dialog,
width=14 * BASE_INC,
height=BASE_INC, height=BASE_INC,
), ),
padding=0, HorizontalLayout(
), LabelModel(
] text="My geometry:",
) width=7 * BASE_INC,
height=BASE_INC,
),
DisplayStateColorModel(
show_string=True,
keys=[f"{device_id}.geometryState"],
width=7 * BASE_INC,
height=BASE_INC,
),
padding=0,
),
]
)
@titled("Device status", width=8 * NARROW_INC) @titled("Device status", width=8 * NARROW_INC)
......
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