Placing a Groovy Section statement inside an iteration, such as each, always generates an error. Seems to destroy the iteration.
Source code
definition(
name: "testSection",
namespace: "hubitat",
author: "AAB",
description: "test section",
category: "Convenience",
iconUrl: "",
iconX2Url: ""
)
preferences {
page(name: "mainPage")
}
def mainPage()
{
dynamicPage(name: "mainPage", title: "Test Section", install: true, uninstall: true)
{
section
{
input "globalLights", "capability.switch", required: true, multiple: true, submitOnChange: true,
title: "One or more Bulbs, Leds or Switches"
}
if (globalLights)
{
globalLights.each
{
section ("${it.label}", hideable: true, hidden: true)
{
input "global${it.id}Lux", "number", required: false, multiple: false, range: "1..8000",submitOnChange: true,
title: "${it.label}<br />Lux On/Off point 1 to 8000. Leave blank to use Standard Lux settings (Optional)"
}
}
}
}
}
def installed() {
initialize()
}
def updated() {
initialize()
}
def initialize()
{
}