From 2536c6908305cba66625253431144324c20a6dcd Mon Sep 17 00:00:00 2001 From: Brian Steere Date: Wed, 5 Jul 2017 16:01:16 -0500 Subject: [PATCH 1/4] Update Every Element with more accurate enum settings Added a couple of extra enum inputs to demonstrate additional states --- .../examples/every-element.src/every-element.groovy | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/smartapps/smartthings/examples/every-element.src/every-element.groovy b/smartapps/smartthings/examples/every-element.src/every-element.groovy index 417ae1c..caad6aa 100644 --- a/smartapps/smartthings/examples/every-element.src/every-element.groovy +++ b/smartapps/smartthings/examples/every-element.src/every-element.groovy @@ -202,7 +202,8 @@ def inputSelectionPage() { section("options variations") { paragraph "tap these elements and look at the differences when selecting an option" - input(type: "enum", name: "selectionSimple", title: "Simple options", description: "no separators in the selectable options", groupedOptions: addGroup(englishOptions + spanishOptions)) + input(type: "enum", name: "selectionSimple", title: "Simple options", description: "no separators in the selectable options", options: ["Thing 1", "Thing 2", "(Complicated) Thing 3"]) + input(type: "enum", name: "selectionSimpleGrouped", title: "Simple (Grouped) options", description: "no separators in the selectable options", groupedOptions: addGroup(englishOptions + spanishOptions)) input(type: "enum", name: "selectionGrouped", title: "Grouped options", description: "separate groups of options with headers", groupedOptions: groupedOptions) } @@ -214,15 +215,15 @@ def inputSelectionPage() { section("segmented") { paragraph "segmented should only work if there are either 2 or 3 options to choose from" - input(type: "enum", name: "selectionSegmented1", style: "segmented", title: "1 option", groupedOptions: addGroup(["One"])) - input(type: "enum", name: "selectionSegmented4", style: "segmented", title: "4 options", groupedOptions: addGroup(["One", "Two", "Three", "Four"])) + input(type: "enum", name: "selectionSegmented1", style: "segmented", title: "1 option", options: ["One"]) + input(type: "enum", name: "selectionSegmented4", style: "segmented", title: "4 options", options: ["One", "Two", "Three", "Four"]) paragraph "multiple and required will have no effect on segmented selection elements. There will always be exactly 1 option selected" input(type: "enum", name: "selectionSegmented2", style: "segmented", title: "2 options", options: ["One", "Two"]) input(type: "enum", name: "selectionSegmented3", style: "segmented", title: "3 options", options: ["One", "Two", "Three"]) paragraph "specifying defaultValue still works with segmented selection elements" - input(type: "enum", name: "selectionSegmentedWithDefault", title: "defaulted to 'two'", groupedOptions: addGroup(["One", "Two", "Three"]), defaultValue: "Two") + input(type: "enum", name: "selectionSegmentedWithDefault", style: "segmented", title: "defaulted to 'two'", options: ["One", "Two", "Three"], defaultValue: "Two") } section("required: true") { @@ -231,6 +232,8 @@ def inputSelectionPage() { section("multiple: true") { input(type: "enum", name: "selectionMultiple", title: "This allows multiple selections", description: "It should look different when nothing is selected", groupedOptions: addGroup(["an option", "another option", "no way, one more?"]), multiple: true) + input(type: "enum", name: "selectionMultipleDefault1", title: "This allows multiple selections with a single default", description: "It should look different when nothing is selected", groupedOptions: addGroup(["an option", "another option", "no way, one more?"]), multiple: true, defaultValue: "an option") + input(type: "enum", name: "selectionMultipleDefault2", title: "This allows multiple selections with multiple defaults", description: "It should look different when nothing is selected", groupedOptions: addGroup(["an option", "another option", "no way, one more?"]), multiple: true, defaultValue: ["an option", "another option"]) } section("with image") { From 1b0437c633a2a7371aa7a862c53d1ba205da3a13 Mon Sep 17 00:00:00 2001 From: juano2310 Date: Wed, 5 Jul 2017 14:00:24 -0400 Subject: [PATCH 2/4] ICP-507 - Replace location count null with 0 Updated with def count = options.size().toString() --- smartapps/smartthings/lifx-connect.src/lifx-connect.groovy | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/smartapps/smartthings/lifx-connect.src/lifx-connect.groovy b/smartapps/smartthings/lifx-connect.src/lifx-connect.groovy index caca7b2..fbda03b 100644 --- a/smartapps/smartthings/lifx-connect.src/lifx-connect.groovy +++ b/smartapps/smartthings/lifx-connect.src/lifx-connect.groovy @@ -72,7 +72,7 @@ def authPage() { log.debug "have LIFX access token" def options = locationOptions() ?: [] - def count = options.size() + def count = options.size().toString() return dynamicPage(name:"Credentials", title:"", nextPage:"", install:true, uninstall: true) { section("Select your location") { From 4da49283bff51c9a45a6a4d52035d29e7e81a40f Mon Sep 17 00:00:00 2001 From: Nathan Cauffman Date: Thu, 6 Jul 2017 13:22:12 -0700 Subject: [PATCH 3/4] MSA-2084: Updated with new model number and health check --- .../spruce-sensor.src/spruce-sensor.groovy | 24 +++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/devicetypes/plaidsystems/spruce-sensor.src/spruce-sensor.groovy b/devicetypes/plaidsystems/spruce-sensor.src/spruce-sensor.groovy index 77a5698..fc1fe39 100644 --- a/devicetypes/plaidsystems/spruce-sensor.src/spruce-sensor.groovy +++ b/devicetypes/plaidsystems/spruce-sensor.src/spruce-sensor.groovy @@ -1,5 +1,5 @@ /** - * Spruce Sensor -Pre-release V2 10/8/2015 + * Spruce Sensor -updated with SLP model number 5/2017 * * Copyright 2014 Plaid Systems * @@ -14,25 +14,34 @@ * -------10/20/2015 Updates-------- -Fix/add battery reporting interval to update - -remove polling and/or refresh(?) + -remove polling and/or refresh + + -------5/2017 Updates-------- + -Add fingerprints for SLP + -add device health, check every 60mins + 2mins */ + metadata { - definition (name: "Spruce Sensor", namespace: "plaidsystems", author: "NCauffman") { + definition (name: "Spruce Sensor", namespace: "plaidsystems", author: "Plaid Systems") { capability "Configuration" capability "Battery" capability "Relative Humidity Measurement" capability "Temperature Measurement" capability "Sensor" + capability "Health Check" //capability "Polling" + attribute "checkInterval", "string" attribute "maxHum", "string" attribute "minHum", "string" + command "resetHumidity" command "refresh" - fingerprint profileId: "0104", inClusters: "0000,0001,0003,0402,0405", outClusters: "0003, 0019", manufacturer: "PLAID SYSTEMS", model: "PS-SPRZMS-01" + fingerprint profileId: "0104", inClusters: "0000,0001,0003,0402,0405", outClusters: "0003, 0019", manufacturer: "PLAID SYSTEMS", model: "PS-SPRZMS-01", deviceJoinName: "Spruce Sensor" + fingerprint profileId: "0104", inClusters: "0000,0001,0003,0402,0405", outClusters: "0003, 0019", manufacturer: "PLAID SYSTEMS", model: "PS-SPRZMS-SLP1", deviceJoinName: "Spruce Sensor" } preferences { @@ -293,6 +302,11 @@ def setConfig(){ sendEvent(name: 'configuration',value: configInterval, descriptionText: "Configuration initialized") } +def installed(){ + //check every 1 hour + 2mins + sendEvent(name: "checkInterval", value: 1 * 60 * 60 + 2 * 60, displayed: false, data: [protocol: "zigbee", hubHardwareId: device.hub.hardwareID]) +} + //when device preferences are changed def updated(){ log.debug "device updated" @@ -303,6 +317,8 @@ def updated(){ sendEvent(name: 'configuration',value: 0, descriptionText: "Settings changed and will update at next report. Measure interval set to ${interval} mins") } } + //check every 1 hour + 2mins + sendEvent(name: "checkInterval", value: 1 * 60 * 60 + 2 * 60, displayed: false, data: [protocol: "zigbee", hubHardwareId: device.hub.hardwareID]) } //poll From f519a2d828ec3e9e5e0673d4af7d35f4d8a9d817 Mon Sep 17 00:00:00 2001 From: natec007 Date: Thu, 6 Jul 2017 14:27:33 -0700 Subject: [PATCH 4/4] Update spruce-sensor.groovy Removed checkInterval attribute sendEvent(name: "checkInterval" already in updated and installed --- .../plaidsystems/spruce-sensor.src/spruce-sensor.groovy | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/devicetypes/plaidsystems/spruce-sensor.src/spruce-sensor.groovy b/devicetypes/plaidsystems/spruce-sensor.src/spruce-sensor.groovy index fc1fe39..f2e1154 100644 --- a/devicetypes/plaidsystems/spruce-sensor.src/spruce-sensor.groovy +++ b/devicetypes/plaidsystems/spruce-sensor.src/spruce-sensor.groovy @@ -32,7 +32,6 @@ metadata { capability "Health Check" //capability "Polling" - attribute "checkInterval", "string" attribute "maxHum", "string" attribute "minHum", "string" @@ -411,4 +410,4 @@ private byte[] reverseArray(byte[] array) { i++; } return array -} \ No newline at end of file +}