Skip to content
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

Added dimming speed for lzw41 and lzw42 #30

Merged
merged 1 commit into from Apr 10, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -48,6 +48,9 @@
* stabilization of color temp and color reporting
* re-organization of device data for standardization / addition of serialnumber, hardware ver, protocol ver, firmware
* re-work of associations
* updated by npk22 4/9/2020
* added dimming speed parameter
* added dimming speed to on / off
*/

import groovy.transform.Field
Expand All @@ -73,6 +76,7 @@ metadata {
configParams.each { input it.value.input }
input name: "colorStaging", type: "bool", description: "", title: "Enable color pre-staging", defaultValue: false
input name: "colorTransition", type: "number", description: "", title: "Color fade time:", defaultValue: 0
input name: "dimmingSpeed", type: "number", description: "", title: "Dimming speed:", defaultValue: 0
input name: "logEnable", type: "bool", title: "Enable debug logging", defaultValue: true
}
}
Expand Down Expand Up @@ -250,15 +254,27 @@ private void dimmerEvents(hubitat.zwave.Command cmd) {
}

void on() {
sendToDevice(zwave.basicV1.basicSet(value: 0xFF))
//Check if dimming speed exists and set the durration
def duration=0
if (dimmingSpeed) duration=dimmingSpeed

sendToDevice(zwave.switchMultilevelV2.switchMultilevelSet(value: 0xFF, dimmingDuration: duration))
}

void off() {
sendToDevice(zwave.basicV1.basicSet(value: 0x00))
//Check if dimming speed exists and set the durration
def duration=0
if (dimmingSpeed) duration=dimmingSpeed

sendToDevice(zwave.switchMultilevelV2.switchMultilevelSet(value: 0x00, dimmingDuration: duration))
}

void setLevel(level) {
setLevel(level, 1)
//Check if dimming speed exists and set the durration
def duration=1
if (dimmingSpeed) duration=dimmingSpeed

setLevel(level, duration)
}

void setLevel(level, duration) {
Expand Down
Expand Up @@ -46,6 +46,9 @@
* stabilization of color temp reporting
* re-organization of device data for standardization / addition of serialnumber, hardware ver, protocol ver, firmware
* re-work of associations
* updated by npk22 4/9/2020
* added dimming speed parameter
* added dimming speed to on / off
*/

import groovy.transform.Field
Expand All @@ -69,7 +72,8 @@ metadata {
preferences {
configParams.each { input it.value.input }
input name: "colorStaging", type: "bool", description: "", title: "Enable color pre-staging", defaultValue: false
input name: "colorTransition", type: "number", description: "", title: "Color fade time:", defaultValue: 0
input name: "colorTransition", type: "number", description: "", title: "Color fade time:", defaultValue: 0
input name: "dimmingSpeed", type: "number", description: "", title: "Dimming speed:", defaultValue: 0
input name: "logEnable", type: "bool", title: "Enable debug logging", defaultValue: true
}
}
Expand Down Expand Up @@ -224,15 +228,27 @@ private void dimmerEvents(hubitat.zwave.Command cmd) {
}

void on() {
sendToDevice(zwave.basicV1.basicSet(value: 0xFF))
//Check if dimming speed exists and set the durration
def duration=0
if (dimmingSpeed) duration=dimmingSpeed

sendToDevice(zwave.switchMultilevelV2.switchMultilevelSet(value: 0xFF, dimmingDuration: duration))
}

void off() {
sendToDevice(zwave.basicV1.basicSet(value: 0x00))
//Check if dimming speed exists and set the durration
def duration=0
if (dimmingSpeed) duration=dimmingSpeed

sendToDevice(zwave.switchMultilevelV2.switchMultilevelSet(value: 0x00, dimmingDuration: duration))
}

void setLevel(level) {
setLevel(level, 1)
//Check if dimming speed exists and set the durration
def duration=1
if (dimmingSpeed) duration=dimmingSpeed

setLevel(level, duration)
}

void setLevel(level, duration) {
Expand Down