Trying to port over the driver for the Fibaro Dimmer 2, but struggling a bit with the preferences.
- default values don’t populate for type: “number”
input type: “number”,
name: “configNightmodeLevel”,
title: “Nightmode Level: The dimmer will always switch on at this level when nightmode is enabled. (Default=10”,
range: “1…100”,
defaultValue: “10”,
required: true
- for
type: “enum”
I can’t useoptions: [value:description]
Example:
input (
name: “configLoggingLevelDevice”,
title: “Device Logging Level: Messages with this level and higher will be logged to the logMessage attribute.”,
type: “enum”,
options: [
“0” : “None”,
“1” : “Error”,
“2” : “Warning”
],
defaultValue: “2”,
required: true
)
Instead I have to loose the descriptions and only enter values:
input (
name: “configLoggingLevelDevice”,
title: “Device Logging Level: Messages with this level and higher will be logged to the logMessage attribute.”,
type: “enum”,
options: [
“0”,
“1”,
“2”
],
defaultValue: “2”,
required: true
)
I know I could use descriptions instead of values, and convert the descriptions into values when using the preference elsewhere in the driver, but that’s a lot of work for 20 odd enum preferences… there must be a better way?
- I’d like to break the preferences into sections, the traditional ST DTH way is as follows:
section { // GENERAL:
input (
type: “paragraph”,
element: “paragraph”,
title: “GENERAL:”,
description: “General device handler settings.”
)
…
}
Type: “paragraph” doesent seem to exist and if I change it to anything else it forces an input box rather than just giving the section a title… an I missing something here?
Thanks in advance!
(P.s. sorry for poorly formatted code snippets, I’m on mobile)