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 @@ -58,11 +58,22 @@ metadata {
defaultValue: false,
displayDuringSetup: false
)

//This setting for calibrationTime is specific to Aeotec Nano Shutter and operates under def updated() - Line 159
input("calibrationTime", "number",
title: "Open/Close timing",
description: "Set the motor's open/close time",
defaultValue: false,
displayDuringSetup: false,
range: "5..255",
default: 10
)
}
}
}

def parse(String description) {
log.debug "parse() - description: $description"
def result = []
if (description.startsWith("Err")) {
result = createEvent(descriptionText:description, isStateChange:true)
Expand Down Expand Up @@ -101,11 +112,14 @@ def zwaveEvent(physicalgraph.zwave.Command cmd) {
}

def setButton(button) {
log.debug "button: $button"
switch(button) {
case "open":
case "statelessCurtainPowerButton_open_button":
open()
break
case "close":
case "statelessCurtainPowerButton_close_button":
close()
break
default:
Expand Down Expand Up @@ -147,13 +161,20 @@ def installed() {
def updated() {
sendHubCommand(pause())
state.reverseDirection = reverseDirection ? reverseDirection : false

if (calibrationTime >= 5 && calibrationTime <= 255) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

did you mean to be checking time instead of calibrationTime here? As far as I can tell they should be equal, though, so I don't know if having a second variable is worthwhile.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree that we should just use calibrationTime here.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@greens @cbaumler - the "int time = calibrationTime" was primarily with me messing around and practicing a little bit while figuring out how preferences are used as numbers/integrrs, i ended up leaving it in there and forgot to remove it when i realized calibrationTime was pretty much a local variable for the device handler.

I'll have that removed.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@greens @cbaumler - edited for this function to only use calibrationTime number.

response([
secure(zwave.configurationV1.configurationSet(parameterNumber: 35, size: 1, scaledConfigurationValue: calibrationTime)),
])
}

}

def configure() {
log.debug "Configure..."
response([
secure(zwave.configurationV1.configurationSet(parameterNumber: 80, size: 1, scaledConfigurationValue: 1)),
secure(zwave.configurationV1.configurationSet(parameterNumber: 85, size: 1, scaledConfigurationValue: 1))
secure(zwave.configurationV1.configurationSet(parameterNumber: 80, size: 1, scaledConfigurationValue: 1)),
secure(zwave.configurationV1.configurationSet(parameterNumber: 85, size: 1, scaledConfigurationValue: 1))
])
}

Expand All @@ -171,4 +192,4 @@ private getOpenValue() {

private getCloseValue() {
!state.reverseDirection ? 0xFF : 0x00
}
}