From 1ad2f8f7598135a9d569e976e0bb7e1cef42998a Mon Sep 17 00:00:00 2001 From: Michael Zanetti Date: Wed, 3 May 2023 19:26:16 +0200 Subject: [PATCH] Use a ComboBox for number states with allowedValues --- nymea-app/ui/devicepages/GenericThingPage.qml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/nymea-app/ui/devicepages/GenericThingPage.qml b/nymea-app/ui/devicepages/GenericThingPage.qml index dcb51884..bcd31dc5 100644 --- a/nymea-app/ui/devicepages/GenericThingPage.qml +++ b/nymea-app/ui/devicepages/GenericThingPage.qml @@ -224,7 +224,9 @@ ThingPageBase { if (stateDelegate.stateType.unit === Types.UnitUnixTime) { sourceComp = "DateTimeDelegate.qml"; } else if (isWritable) { - if (stateDelegate.stateType.minValue !== undefined && stateDelegate.stateType.maxValue !== undefined) { + if (stateDelegate.stateType.allowedValues.length > 0) { + sourceComp = "ComboBoxDelegate.qml"; + } else if (stateDelegate.stateType.minValue !== undefined && stateDelegate.stateType.maxValue !== undefined) { sourceComp = "SliderDelegate.qml"; } else { sourceComp = "SpinBoxDelegate.qml";