mirror of
https://github.com/mtan93/SmartThingsPublic.git
synced 2026-03-30 14:13:06 +01:00
Merge pull request #280 from workingmonk/lock_raw_command
temporary changes to the lock DTH
This commit is contained in:
@@ -91,11 +91,24 @@ def uninstalled() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
def configure() {
|
def configure() {
|
||||||
|
/*
|
||||||
def cmds =
|
def cmds =
|
||||||
zigbee.configSetup("${CLUSTER_DOORLOCK}", "${DOORLOCK_ATTR_LOCKSTATE}",
|
zigbee.configSetup("${CLUSTER_DOORLOCK}", "${DOORLOCK_ATTR_LOCKSTATE}",
|
||||||
"${TYPE_ENUM8}", 0, 3600, "{01}") +
|
"${TYPE_ENUM8}", 0, 3600, "{01}") +
|
||||||
zigbee.configSetup("${CLUSTER_POWER}", "${POWER_ATTR_BATTERY_PERCENTAGE_REMAINING}",
|
zigbee.configSetup("${CLUSTER_POWER}", "${POWER_ATTR_BATTERY_PERCENTAGE_REMAINING}",
|
||||||
"${TYPE_U8}", 3600, 3600, "{01}")
|
"${TYPE_U8}", 600, 21600, "{01}")
|
||||||
|
*/
|
||||||
|
def zigbeeId = device.zigbeeId
|
||||||
|
def cmds =
|
||||||
|
[
|
||||||
|
"zdo bind 0x${device.deviceNetworkId} 0x${device.endpointId} 1 ${CLUSTER_DOORLOCK} {$zigbeeId} {}", "delay 200",
|
||||||
|
"zcl global send-me-a-report ${CLUSTER_DOORLOCK} ${DOORLOCK_ATTR_LOCKSTATE} ${TYPE_ENUM8} 0 3600 {01}", "delay 200",
|
||||||
|
"send 0x${device.deviceNetworkId} 1 0x${device.endpointId}", "delay 200",
|
||||||
|
|
||||||
|
"zdo bind 0x${device.deviceNetworkId} 0x${device.endpointId} 1 ${CLUSTER_POWER} {$zigbeeId} {}", "delay 200",
|
||||||
|
"zcl global send-me-a-report ${CLUSTER_POWER} ${POWER_ATTR_BATTERY_PERCENTAGE_REMAINING} ${TYPE_U8} 600 21600 {01}", "delay 200",
|
||||||
|
"send 0x${device.deviceNetworkId} 1 0x${device.endpointId}", "delay 200",
|
||||||
|
]
|
||||||
log.info "configure() --- cmds: $cmds"
|
log.info "configure() --- cmds: $cmds"
|
||||||
return cmds + refresh() // send refresh cmds as part of config
|
return cmds + refresh() // send refresh cmds as part of config
|
||||||
}
|
}
|
||||||
@@ -125,13 +138,15 @@ def parse(String description) {
|
|||||||
def lock() {
|
def lock() {
|
||||||
def cmds = zigbee.zigbeeCommand("${CLUSTER_DOORLOCK}", "${DOORLOCK_CMD_LOCK_DOOR}", "{}")
|
def cmds = zigbee.zigbeeCommand("${CLUSTER_DOORLOCK}", "${DOORLOCK_CMD_LOCK_DOOR}", "{}")
|
||||||
log.info "lock() -- cmds: $cmds"
|
log.info "lock() -- cmds: $cmds"
|
||||||
return cmds
|
//return cmds
|
||||||
|
"st cmd 0x${device.deviceNetworkId} 0x${device.endpointId} ${CLUSTER_DOORLOCK} ${DOORLOCK_CMD_LOCK_DOOR} {}"
|
||||||
}
|
}
|
||||||
|
|
||||||
def unlock() {
|
def unlock() {
|
||||||
def cmds = zigbee.zigbeeCommand("${CLUSTER_DOORLOCK}", "${DOORLOCK_CMD_UNLOCK_DOOR}", "{}")
|
def cmds = zigbee.zigbeeCommand("${CLUSTER_DOORLOCK}", "${DOORLOCK_CMD_UNLOCK_DOOR}", "{}")
|
||||||
log.info "unlock() -- cmds: $cmds"
|
log.info "unlock() -- cmds: $cmds"
|
||||||
return cmds
|
//return cmds
|
||||||
|
"st cmd 0x${device.deviceNetworkId} 0x${device.endpointId} ${CLUSTER_DOORLOCK} ${DOORLOCK_CMD_UNLOCK_DOOR} {}"
|
||||||
}
|
}
|
||||||
|
|
||||||
// Private methods
|
// Private methods
|
||||||
|
|||||||
Reference in New Issue
Block a user