Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ metadata {
command "reset"

fingerprint mfr: "0159", prod: "0002", model: "0051", deviceJoinName: "Qubino Switch 1" //Qubino Flush 2 Relay
fingerprint mfr: "0159", prod: "0002", model: "0052", deviceJoinName: "Qubino Switch" //Qubino Flush 1 Relay
fingerprint mfr: "0159", prod: "0002", model: "0053", deviceJoinName: "Qubino Switch" //Qubino Flush 1D Relay
}

tiles(scale: 2) {
Expand Down Expand Up @@ -70,7 +72,12 @@ metadata {
}

def installed() {
state.numberOfSwitches = 2
if (zwaveInfo?.model.equals("0051")) {
state.numberOfSwitches = 2
} else {
state.numberOfSwitches = 1
}

if (!childDevices) {
addChildSwitches(state.numberOfSwitches)
}
Expand All @@ -93,7 +100,7 @@ def updated() {
}
// Preferences template begin
parameterMap.each {
if (isPreferenceChanged(it)) {
if (isPreferenceChanged(it) && !excludeParameterFromSync(it)) {
log.debug "Preference ${it.key} has been updated from value: ${state.currentPreferencesState."$it.key".value} to ${settings."$it.key"}"
state.currentPreferencesState."$it.key".status = "syncPending"
} else if (!state.currentPreferencesState."$it.key".value) {
Expand All @@ -104,6 +111,20 @@ def updated() {
// Preferences template end
}

def excludeParameterFromSync(preference){
def exclude = false
if (preference.key == "outputQ2SwitchSelection") {
if (zwaveInfo?.model?.equals("0052") || zwaveInfo?.model?.equals("0053")) {
exclude = true
}
}

if (exclude) {
log.warn "Preference no ${preference.parameterNumber} - ${preference.key} is not supported by this device"
}
return exclude
}

private syncConfiguration() {
def commands = []
parameterMap.each {
Expand Down Expand Up @@ -446,6 +467,6 @@ private getParameterMap() {[
0: "When system is turned off the output is 0V (NC).",
1: "When system is turned off the output is 230V (NO).",
],
description: "Set value means the type of the device that is connected to the Q2 output. The device type can be normally open (NO) or normally close (NC). "
description: "(Only for Qubino Flush 2 Relay) Set value means the type of the device that is connected to the Q2 output. The device type can be normally open (NO) or normally close (NC). "
]
]}