Skip to content

Commit 58d19fa

Browse files
author
Adrian Caramaliu
committed
v0.3.163.20161102 - RC - Adjustments to better fit the Ring integration - assuming 1 button if no numberOfButtons (may break other DTH implementations), assuming button #1 pushed if no buttonNumber is provided
1 parent 991637c commit 58d19fa

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

smartapps/ady624/core.src/core.groovy

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
*/
2121
def version() { return "v0.3.162.20161028" }
2222
/*
23+
* 11/02/2016 >>> v0.3.163.20161102 - RC - Adjustments to better fit the Ring integration - assuming 1 button if no numberOfButtons (may break other DTH implementations), assuming button #1 pushed if no buttonNumber is provided
2324
* 10/28/2016 >>> v0.3.162.20161028 - RC - Minor speed improvement for getNextConditionId()
2425
* 10/27/2016 >>> v0.3.161.20161027 - RC - Fixed a bug affecting the queueAskAlexaMessage virtual command task
2526
* 10/14/2016 >>> v0.3.160.20161014 - RC - Fixed a bug not allowing Set color to work when using HSL instead of a simple color. Compliments to @simonselmer
@@ -4607,8 +4608,11 @@ private evaluateDeviceCondition(condition, evt) {
46074608
if (evt && capability && capability.count && capability.data) {
46084609
//at this point we won't evaluate this condition unless we have the right sub device below
46094610
hasSubDevices = true
4610-
setVariable("\$currentEventDeviceIndex", cast(evt.jsonData ? evt.jsonData[capability.data] : 0, "number"), true)
4611-
def subDeviceId = "#${evt.jsonData ? evt.jsonData[capability.data] : "0"}".trim()
4611+
def idx = cast(evt.jsonData ? evt.jsonData[capability.data] : 0, "number")
4612+
//if button index is 0, make it 1
4613+
if ((attr.name == "button") && (idx == 0)) idx = 1
4614+
setVariable("\$currentEventDeviceIndex", idx, true)
4615+
def subDeviceId = "#$idx".trim()
46124616
def subDevices = condition.sdev ?: []
46134617
if (subDeviceId == "#0") subDeviceId = "(none)"
46144618
if (subDevices && subDevices.size()) {
@@ -10046,7 +10050,7 @@ private listCommonDeviceSubDevices(devices, countAttributes, prefix = "") {
1004610050
countAttributes = []
1004710051
}
1004810052
for (device in devices) {
10049-
def cnt = device.name.toLowerCase().contains("lock") ? 32 : 4
10053+
def cnt = device.name.toLowerCase().contains("lock") ? 32 : 1
1005010054
switch (device.name) {
1005110055
case "Aeon Minimote":
1005210056
case "Aeon Key Fob":

0 commit comments

Comments
 (0)