Add 'brightness' as a secondary_info option (#5731)

This commit is contained in:
Ian Richardson 2020-05-12 11:29:43 -05:00 committed by GitHub
parent 96ab057853
commit 845511e322
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 1 deletions

View File

@ -34,7 +34,8 @@ export interface EntitiesCardEntityConfig extends EntityConfig {
| "last-changed"
| "last-triggered"
| "position"
| "tilt-position";
| "tilt-position"
| "brightness";
action_name?: string;
service?: string;
service_data?: object;

View File

@ -122,6 +122,11 @@ class HuiGenericEntityRow extends LitElement {
? `${this.hass.localize("ui.card.cover.tilt_position")}: ${
stateObj.attributes.current_tilt_position
}`
: this.config.secondary_info === "brightness" &&
stateObj.attributes.brightness
? html`${Math.round(
(stateObj.attributes.brightness / 255) * 100
)}%`
: "")}
</div>
`