Skip to content

Commit

Permalink
ICP-4756 Add initial polling to GE Switches (SmartThingsCommunity#3026)
Browse files Browse the repository at this point in the history
ICP-4756 Add initial polling to GE Switches

fix tabs & spaces
  • Loading branch information
greens authored Apr 24, 2018
1 parent be5cede commit 0d7799d
Showing 1 changed file with 19 additions and 19 deletions.
38 changes: 19 additions & 19 deletions devicetypes/smartthings/zwave-switch.src/zwave-switch.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ metadata {
definition (name: "Z-Wave Switch", namespace: "smartthings", author: "SmartThings", ocfDeviceType: "oic.d.switch", runLocally: true, minHubCoreVersion: '000.017.0012', executeCommandsLocally: false) {
capability "Actuator"
capability "Indicator"
capability "Switch"
capability "Switch"
capability "Refresh"
capability "Sensor"
capability "Health Check"
Expand Down Expand Up @@ -70,23 +70,23 @@ def installed() {
}

def updated(){
// Device-Watch simply pings if no device events received for 32min(checkInterval)
sendEvent(name: "checkInterval", value: 2 * 15 * 60 + 2 * 60, displayed: false, data: [protocol: "zwave", hubHardwareId: device.hub.hardwareID, offlinePingable: "1"])
switch (ledIndicator) {
case "on":
indicatorWhenOn()
break
case "off":
indicatorWhenOff()
break
case "never":
indicatorNever()
break
default:
indicatorWhenOn()
break
}
sendHubCommand(new physicalgraph.device.HubAction(zwave.manufacturerSpecificV1.manufacturerSpecificGet().format()))
// Device-Watch simply pings if no device events received for 32min(checkInterval)
sendEvent(name: "checkInterval", value: 2 * 15 * 60 + 2 * 60, displayed: false, data: [protocol: "zwave", hubHardwareId: device.hub.hardwareID, offlinePingable: "1"])
switch (ledIndicator) {
case "on":
indicatorWhenOn()
break
case "off":
indicatorWhenOff()
break
case "never":
indicatorNever()
break
default:
indicatorWhenOn()
break
}
response(refresh())
}

def getCommandClassVersions() {
Expand Down Expand Up @@ -180,7 +180,7 @@ def off() {
* PING is used by Device-Watch in attempt to reach the Device
**/
def ping() {
zwave.switchBinaryV1.switchBinaryGet().format()
zwave.switchBinaryV1.switchBinaryGet().format()
}

def refresh() {
Expand Down

0 comments on commit 0d7799d

Please sign in to comment.