Skip to content

Commit 872354d

Browse files
authored
Merge pull request #241 from kamtschatka/master
Allow Default values for entities/allow still creating the row element #191
2 parents 0cfc0a3 + 540edc9 commit 872354d

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

README.md

+1
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ attribute value instead of the state value. `icon` lets you display an icon inst
8080
| toggle | bool | `false` | Display a toggle if supported by domain |
8181
| icon | string/bool | `false` | Display default or custom icon instead of state or attribute value |
8282
| state_color | bool | `false` | Enable colored icon when entity is active |
83+
| default | string | | Display this value if the entity does not exist or should not be shown |
8384
| hide_unavailable | bool | `false` | Hide entity if unavailable or not found |
8485
| hide_if | object/any | _[Hiding](#hiding)_ | Hide entity if its value matches specified value or criteria |
8586
| styles | object | | Add custom CSS styles to the entity element |

src/index.js

+6
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,12 @@ class MultipleEntityRow extends LitElement {
107107

108108
renderEntity(stateObj, config) {
109109
if (!stateObj || hideIf(stateObj, config)) {
110+
if (config.default) {
111+
return html`<div class="entity" style="${entityStyles(config)}">
112+
<span>${config.name}</span>
113+
<div>${config.default}</div>
114+
</div>`;
115+
}
110116
return null;
111117
}
112118
const onClick = this.clickHandler(stateObj.entity_id, config.tap_action);

0 commit comments

Comments
 (0)