On Hass 0.58.1 this no longer works for me on the iOS app, but works fine on the PC. The text is not shown so its just a blank card. I have the text stored in an attribute named text since the state is limited to 255 characters.
Maybe @andrey has an idea? It works if i use the extra data from his Custom UI but that doesnt satisfy my need of splitting the text into several rows
<!--
https://github.com/home-assistant/home-assistant-polymer/blob/master/src/state-summary/state-card-display.html
https://github.com/home-assistant/home-assistant-polymer/blob/master/src/components/entity/state-badge.html
-->
<dom-module id="state-card-value_only">
<template>
<style is="custom-style" include="iron-flex iron-flex-alignment"></style>
<style>
.normal {
@apply(--paper-font-body1);
color: var(--primary-text-color);
margin-left: 8px;
text-align: left;
line-height: 20px;
}
.bold {
@apply(--paper-font-body1);
color: var(--primary-text-color);
font-weight: bold;
font-style: italic;
margin-left: 8px;
text-align: left;
line-height: 20px;
}
.atention {
@apply(--paper-font-body1);
color: var(--google-red-500);
margin-left: 8px;
text-align: left;
line-height: 20px;
}
.hidden {
@apply(--paper-font-body1);
color: var(--paper-card-background-color);
margin-left: 8px;
text-align: left;
line-height: 20px;
}
</style>
<template is="dom-repeat" items="[[computeStateDisplay(stateObj)]]">
<div class$="[[computeClass(item)]]">[[computeItem(item)]]</div>
</template>
</template>
</dom-module>
<script>
Polymer({
is: 'state-card-value_only',
properties: {
hass: {
type: Object,
},
stateObj: {
type: Object,
},
},
computeStateDisplay: function (stateObj) {
//window.hassUtil.computeStateState(stateObj);
return stateObj.attributes.text.split("\n");
},
computeItem: function (item) {
var value = item.trim();
switch(value.substring(0,1)) {
case "*":
case "!":
return value.substring(1);
default:
return value;
}
},
computeClass: function (item) {
switch(item.trim().substring(0,1)) {
case "*": return "bold";
case "!": return "atention";
default: return "normal";
}
},
});
</script>