mirror of
https://github.com/mtan93/SmartThingsPublic.git
synced 2026-04-09 22:05:01 +01:00
One further fix for NPEs
This commit is contained in:
@@ -34,7 +34,7 @@ preferences {
|
|||||||
|
|
||||||
def mainPage() {
|
def mainPage() {
|
||||||
dynamicPage(name: "mainPage", title: "", install: true, uninstall: false) {
|
dynamicPage(name: "mainPage", title: "", install: true, uninstall: false) {
|
||||||
def masterInList = slaves.id.find{it==master.id}
|
def masterInList = slaves?.id?.find{it==master?.id}
|
||||||
if (masterInList) {
|
if (masterInList) {
|
||||||
section ("**WARNING**"){
|
section ("**WARNING**"){
|
||||||
paragraph "You have included the Master Light in the Slave Group. This will cause a loop in execution. Please remove this device from the Slave Group.", image: "https://raw.githubusercontent.com/MichaelStruck/SmartThingsPublic/master/img/caution.png"
|
paragraph "You have included the Master Light in the Slave Group. This will cause a loop in execution. Please remove this device from the Slave Group.", image: "https://raw.githubusercontent.com/MichaelStruck/SmartThingsPublic/master/img/caution.png"
|
||||||
@@ -83,7 +83,7 @@ def init() {
|
|||||||
//-----------------------------------
|
//-----------------------------------
|
||||||
def onOffHandler(evt){
|
def onOffHandler(evt){
|
||||||
if (slaves && master) {
|
if (slaves && master) {
|
||||||
if (!slaves?.id.find{it==master.id}){
|
if (!slaves?.id.find{it==master?.id}){
|
||||||
if (master?.currentValue("switch") == "on"){
|
if (master?.currentValue("switch") == "on"){
|
||||||
if (randomYes) getRandomColorMaster()
|
if (randomYes) getRandomColorMaster()
|
||||||
else slaves?.on()
|
else slaves?.on()
|
||||||
@@ -97,7 +97,7 @@ def onOffHandler(evt){
|
|||||||
|
|
||||||
def colorHandler(evt) {
|
def colorHandler(evt) {
|
||||||
if (slaves && master) {
|
if (slaves && master) {
|
||||||
if (!slaves?.id?.find{it==master.id} && master?.currentValue("switch") == "on"){
|
if (!slaves?.id?.find{it==master?.id} && master?.currentValue("switch") == "on"){
|
||||||
log.debug "Changing Slave units H,S,L"
|
log.debug "Changing Slave units H,S,L"
|
||||||
def dimLevel = master?.currentValue("level")
|
def dimLevel = master?.currentValue("level")
|
||||||
def hueLevel = master?.currentValue("hue")
|
def hueLevel = master?.currentValue("hue")
|
||||||
|
|||||||
Reference in New Issue
Block a user