-
Notifications
You must be signed in to change notification settings - Fork 89.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[ICP-13444] Delete child switches on Flush Relay 1/1D #40329
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -74,11 +74,12 @@ metadata { | |
def installed() { | ||
if (zwaveInfo?.model.equals("0051")) { | ||
state.numberOfSwitches = 2 | ||
} else { | ||
|
||
} else if (zwaveInfo?.model.equals("0052") && zwaveInfo?.model.equals("0053")){ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I guess you've meant to put There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @PKacprowiczS thanks! Fixed |
||
state.numberOfSwitches = 1 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. you'd still need to add an explicit else here I think to avoid an NPE (just in case) Also this doesn't really alter any of the behavior of the device, since these two models would have been defaulting to 1 in the first place, right? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Okay. Please add back a default case here (or remove the model checks you added). There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
} | ||
|
||
if (!childDevices) { | ||
if (!childDevices && state.numberOfSwitches > 1) { | ||
addChildSwitches(state.numberOfSwitches) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What was happening before with There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It was still adding two children switches |
||
} | ||
sendEvent(name: "checkInterval", value: 2 * 15 * 60 + 2 * 60, displayed: false, data: [protocol: "zwave", hubHardwareId: device.hub.hardwareID]) | ||
|
@@ -93,12 +94,12 @@ def installed() { | |
} | ||
// Preferences template end | ||
response([ | ||
refresh((1..state.numberOfSwitches).toList()) | ||
refresh((1..state.numberOfSwitches).toList()) | ||
]) | ||
} | ||
|
||
def updated() { | ||
if (!childDevices) { | ||
if (!childDevices && state.numberOfSwitches > 1) { | ||
addChildSwitches(state.numberOfSwitches) | ||
} | ||
// Preferences template begin | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
new line shouldn't be here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed :)