adding multi-line text for standard and value tiles

This commit is contained in:
Matt Pennig
2016-04-26 13:13:20 -05:00
parent 1e27ff5d4a
commit 5ac08e5a92
2 changed files with 25 additions and 3 deletions

View File

@@ -80,19 +80,31 @@ metadata {
state "default", label:'' state "default", label:''
} }
main("standard1") // multi-line text (explicit newlines)
standardTile("multiLine", "device.multiLine", width: 2, height: 2) {
state "default", label: '${currentValue}'
}
standardTile("multiLineWithIcon", "device.multiLine", width: 2, height: 2) {
state "default", label: '${currentValue}', icon: "st.switches.switch.off"
}
main("actionRings")
details([ details([
"actionRings", "actionFlat", "noActionFlat", "actionRings", "actionFlat", "noActionFlat",
"flatLabel", "flatIconLabel", "flatIcon", "flatLabel", "flatIconLabel", "flatIcon",
"flatDefaultState", "flatImplicitDefaultState1", "flatImplicitDefaultState2", "flatDefaultState", "flatImplicitDefaultState1", "flatImplicitDefaultState2",
"multiLine", "multiLineWithIcon"
]) ])
} }
} }
def installed() { def installed() {
sendEvent(name: "switch", value: "off") sendEvent(name: "switch", value: "off")
sendEvent(name: "multiLine", value: "Line 1\nLine 2\nLine 3")
} }
def parse(String description) { def parse(String description) {

View File

@@ -69,16 +69,25 @@ metadata {
] ]
} }
valueTile("noValue", "device.nada", width: 2, height: 2) { valueTile("noValue", "device.nada", width: 4, height: 2) {
state "default", label:'${currentValue}' state "default", label:'${currentValue}'
} }
valueTile("multiLine", "device.multiLine", width: 3, height: 2) {
state "default", label: '${currentValue}'
}
valueTile("multiLineWithIcon", "device.multiLine", width: 3, height: 2) {
state "default", label: '${currentValue}', icon: "st.switches.switch.off"
}
main("text") main("text")
details([ details([
"text", "longText", "integer", "text", "longText", "integer",
"integerFloat", "pi", "floatAsText", "integerFloat", "pi", "floatAsText",
"bgColor", "bgColorRange", "bgColorRangeSingleItem", "bgColor", "bgColorRange", "bgColorRangeSingleItem",
"bgColorRangeConflict", "noValue" "bgColorRangeConflict", "noValue",
"multiLine", "multiLineWithIcon"
]) ])
} }
} }
@@ -90,6 +99,7 @@ def installed() {
sendEvent(name: "integerFloat", value: 47.0) sendEvent(name: "integerFloat", value: 47.0)
sendEvent(name: "pi", value: 3.14159) sendEvent(name: "pi", value: 3.14159)
sendEvent(name: "floatAsText", value: "3.14159") sendEvent(name: "floatAsText", value: "3.14159")
sendEvent(name: "multiLine", value: "Line 1\nLine 2\nLine 3")
} }
def parse(String description) { def parse(String description) {