Skip to content

Commit 566425c

Browse files
committed
Merge pull request SmartThingsCommunity#869 from SmartThingsCommunity/staging
Rolling up staging to production 05-10
2 parents 973c16f + e7448e7 commit 566425c

File tree

4 files changed

+66
-10
lines changed

4 files changed

+66
-10
lines changed

devicetypes/smartthings/tile-ux/tile-basic-standard.src/tile-basic-standard.groovy

+13-1
Original file line numberDiff line numberDiff line change
@@ -80,19 +80,31 @@ metadata {
8080
state "default", label:''
8181
}
8282

83-
main("standard1")
83+
// multi-line text (explicit newlines)
84+
standardTile("multiLine", "device.multiLine", width: 2, height: 2) {
85+
state "default", label: '${currentValue}'
86+
}
87+
88+
standardTile("multiLineWithIcon", "device.multiLine", width: 2, height: 2) {
89+
state "default", label: '${currentValue}', icon: "st.switches.switch.off"
90+
}
91+
92+
main("actionRings")
8493
details([
8594
"actionRings", "actionFlat", "noActionFlat",
8695

8796
"flatLabel", "flatIconLabel", "flatIcon",
8897

8998
"flatDefaultState", "flatImplicitDefaultState1", "flatImplicitDefaultState2",
99+
100+
"multiLine", "multiLineWithIcon"
90101
])
91102
}
92103
}
93104

94105
def installed() {
95106
sendEvent(name: "switch", value: "off")
107+
sendEvent(name: "multiLine", value: "Line 1\nLine 2\nLine 3")
96108
}
97109

98110
def parse(String description) {

devicetypes/smartthings/tile-ux/tile-basic-value.src/tile-basic-value.groovy

+12-2
Original file line numberDiff line numberDiff line change
@@ -69,16 +69,25 @@ metadata {
6969
]
7070
}
7171

72-
valueTile("noValue", "device.nada", width: 2, height: 2) {
72+
valueTile("noValue", "device.nada", width: 4, height: 2) {
7373
state "default", label:'${currentValue}'
7474
}
7575

76+
valueTile("multiLine", "device.multiLine", width: 3, height: 2) {
77+
state "default", label: '${currentValue}'
78+
}
79+
80+
valueTile("multiLineWithIcon", "device.multiLine", width: 3, height: 2) {
81+
state "default", label: '${currentValue}', icon: "st.switches.switch.off"
82+
}
83+
7684
main("text")
7785
details([
7886
"text", "longText", "integer",
7987
"integerFloat", "pi", "floatAsText",
8088
"bgColor", "bgColorRange", "bgColorRangeSingleItem",
81-
"bgColorRangeConflict", "noValue"
89+
"bgColorRangeConflict", "noValue",
90+
"multiLine", "multiLineWithIcon"
8291
])
8392
}
8493
}
@@ -90,6 +99,7 @@ def installed() {
9099
sendEvent(name: "integerFloat", value: 47.0)
91100
sendEvent(name: "pi", value: 3.14159)
92101
sendEvent(name: "floatAsText", value: "3.14159")
102+
sendEvent(name: "multiLine", value: "Line 1\nLine 2\nLine 3")
93103
}
94104

95105
def parse(String description) {

devicetypes/smartthings/tile-ux/tile-multiattribute-generic.src/tile-multiattribute-generic.groovy

+35-2
Original file line numberDiff line numberDiff line change
@@ -67,14 +67,47 @@ metadata {
6767
attributeState "VALUE_DOWN", action: "levelDown"
6868
}
6969
}
70+
multiAttributeTile(name:"lengthyTile", type:"generic", width:6, height:4) {
71+
tileAttribute("device.lengthyText", key: "PRIMARY_CONTROL") {
72+
attributeState "default", label:'The value of this tile is long and should wrap to two lines', backgroundColor:"#79b821"
73+
}
74+
tileAttribute("device.lengthyText", key: "SECONDARY_CONTROL") {
75+
attributeState "default", label:'The value of this tile is long and should wrap to two lines', backgroundColor:"#79b821"
76+
}
77+
}
78+
multiAttributeTile(name:"multilineTile", type:"generic", width:6, height:4) {
79+
tileAttribute("device.multilineText", key: "PRIMARY_CONTROL") {
80+
attributeState "default", label:'Line 1 YES\nLine 2 YES\nLine 3 NO', backgroundColor:"#79b821"
81+
}
82+
tileAttribute("device.multilineText", key: "SECONDARY_CONTROL") {
83+
attributeState "default", label:'Line 1 YES\nLine 2 YES\nLine 3 NO', backgroundColor:"#79b821"
84+
}
85+
}
86+
multiAttributeTile(name:"lengthyTileWithIcon", type:"generic", width:6, height:4) {
87+
tileAttribute("device.lengthyText", key: "PRIMARY_CONTROL") {
88+
attributeState "default", label:'The value of this tile is long and should wrap to two lines', backgroundColor:"#79b821", icon: "st.switches.switch.on"
89+
}
90+
tileAttribute("device.lengthyText", key: "SECONDARY_CONTROL") {
91+
attributeState "default", label:'The value of this tile is long and should wrap to two lines', backgroundColor:"#79b821", icon: "st.switches.switch.on"
92+
}
93+
}
94+
multiAttributeTile(name:"multilineTileWithIcon", type:"generic", width:6, height:4) {
95+
tileAttribute("device.multilineText", key: "PRIMARY_CONTROL") {
96+
attributeState "default", label:'Line 1 YES\nLine 2 YES\nLine 3 NO', backgroundColor:"#79b821", icon: "st.switches.switch.on"
97+
}
98+
tileAttribute("device.multilineText", key: "SECONDARY_CONTROL") {
99+
attributeState "default", label:'Line 1 YES\nLine 2 YES\nLine 3 NO', backgroundColor:"#79b821", icon: "st.switches.switch.on"
100+
}
101+
}
70102

71103
main(["basicTile"])
72-
details(["basicTile", "sliderTile", "valueTile"])
104+
details(["basicTile", "sliderTile", "valueTile", "lengthyTile", "multilineTile", "lengthyTileWithIcon", "multilineTileWithIcon"])
73105
}
74106
}
75107

76108
def installed() {
77-
109+
sendEvent(name: "lengthyText", value: "The value of this tile is long and should wrap to two lines")
110+
sendEvent(name: "multilineText", value: "Line 1 YES\nLine 2 YES\nLine 3 NO")
78111
}
79112

80113
def parse() {

smartapps/smartthings/hue-connect.src/hue-connect.groovy

+6-5
Original file line numberDiff line numberDiff line change
@@ -332,8 +332,7 @@ private addChildBulb(dni, hueType, name, hub, update=false, device = null) {
332332

333333
if (deviceType) {
334334
return addChildDevice("smartthings", deviceType, dni, hub, ["label": name])
335-
}
336-
else {
335+
} else {
337336
log.warn "Device type $hueType not supported"
338337
return null
339338
}
@@ -349,16 +348,18 @@ def addBulbs() {
349348
newHueBulb = bulbs.find { (app.id + "/" + it.value.id) == dni }
350349
if (newHueBulb != null) {
351350
d = addChildBulb(dni, newHueBulb?.value?.type, newHueBulb?.value?.name, newHueBulb?.value?.hub)
352-
log.debug "created ${d.displayName} with id $dni"
353-
d.refresh()
351+
if (d) {
352+
log.debug "created ${d.displayName} with id $dni"
353+
d.refresh()
354+
}
354355
} else {
355356
log.debug "$dni in not longer paired to the Hue Bridge or ID changed"
356357
}
357358
} else {
358359
//backwards compatable
359360
newHueBulb = bulbs.find { (app.id + "/" + it.id) == dni }
360361
d = addChildBulb(dni, "Extended Color Light", newHueBulb?.value?.name, newHueBulb?.value?.hub)
361-
d.refresh()
362+
d?.refresh()
362363
}
363364
} else {
364365
log.debug "found ${d.displayName} with id $dni already exists, type: '$d.typeName'"

0 commit comments

Comments
 (0)