mirror of
https://github.com/mtan93/SmartThingsPublic.git
synced 2026-04-04 06:13:07 +01:00
Merge pull request #1652 from varzac/dimmer-fixes
DPROT-242 Properly handle setLevel for zigbee-dimmer
This commit is contained in:
@@ -93,7 +93,13 @@ def on() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
def setLevel(value) {
|
def setLevel(value) {
|
||||||
zigbee.setLevel(value)
|
def additionalCmds = []
|
||||||
|
if (device.getDataValue("model") == "iQBR30" && value.toInteger() > 0) { // Handle iQ bulb not following spec
|
||||||
|
additionalCmds = zigbee.on()
|
||||||
|
} else if (device.getDataValue("manufacturer") == "MRVL") { // Handle marvel stack not reporting
|
||||||
|
additionalCmds = refresh()
|
||||||
|
}
|
||||||
|
zigbee.setLevel(value) + additionalCmds
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* PING is used by Device-Watch in attempt to reach the Device
|
* PING is used by Device-Watch in attempt to reach the Device
|
||||||
@@ -103,7 +109,7 @@ def ping() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
def refresh() {
|
def refresh() {
|
||||||
zigbee.onOffRefresh() + zigbee.levelRefresh() + zigbee.onOffConfig(0, 300) + zigbee.levelConfig()
|
zigbee.onOffRefresh() + zigbee.levelRefresh()
|
||||||
}
|
}
|
||||||
|
|
||||||
def configure() {
|
def configure() {
|
||||||
@@ -113,5 +119,5 @@ def configure() {
|
|||||||
sendEvent(name: "checkInterval", value: 2 * 10 * 60 + 1 * 60, displayed: false, data: [protocol: "zigbee", hubHardwareId: device.hub.hardwareID])
|
sendEvent(name: "checkInterval", value: 2 * 10 * 60 + 1 * 60, displayed: false, data: [protocol: "zigbee", hubHardwareId: device.hub.hardwareID])
|
||||||
|
|
||||||
// OnOff minReportTime 0 seconds, maxReportTime 5 min. Reporting interval if no activity
|
// OnOff minReportTime 0 seconds, maxReportTime 5 min. Reporting interval if no activity
|
||||||
zigbee.onOffRefresh() + zigbee.levelRefresh() + zigbee.onOffConfig(0, 300) + zigbee.levelConfig()
|
refresh() + zigbee.onOffConfig(0, 300) + zigbee.levelConfig()
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user