Skip to content

Commit

Permalink
v5.9.3
Browse files Browse the repository at this point in the history
  • Loading branch information
dckiller51 committed Jan 14, 2023
1 parent 0c0ef6f commit 68f0348
Show file tree
Hide file tree
Showing 19 changed files with 118 additions and 49 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

All notable changes to this project will be documented in this file.

## v5.9.3

- added always show details

## v5.9.2

- added Polish language support (thank you @LukaszP2)
Expand Down
97 changes: 53 additions & 44 deletions dist/body-miscale-card.js

Large diffs are not rendered by default.

5 changes: 3 additions & 2 deletions src/body-miscale-card.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ export class BodyMiScaleCard extends LitElement implements LovelaceCard {
show_body: config.show_body,
show_buttons: config.show_buttons,
show_toolbar: config.show_toolbar,
always_show_details: config.always_show_details,
...config,
states: deepMerge(states, model.states, config.states),
attributes: config.unit ? deepMerge(attributes_lb, model.attributes_lb, config.attributes) : deepMerge(attributes_kg, model.attributes_kg, config.attributes),
Expand Down Expand Up @@ -140,7 +141,7 @@ export class BodyMiScaleCard extends LitElement implements LovelaceCard {
</div>
</div>
${this.renderToolbar()}
<div id="items" ?open=${this.open}>
<div id="items" ?open=${this.open || this.config.always_show_details}>
<div id="score" class="card-content" style="${this.config.direction == 'up' ? '' : 'flex-grow: 0;'}">
${Object.values(this.config.body)
.filter((v) => v)
Expand Down Expand Up @@ -466,7 +467,7 @@ export class BodyMiScaleCard extends LitElement implements LovelaceCard {
@click=${this.toggle}
title="${localize('common.toggle_power')}"
style="color: var(--primary-color);">
<ha-icon icon=${this.open ? 'mdi:chevron-up' : 'mdi:chevron-down'}></ha-icon>
<ha-icon icon=${this.config.always_show_details ? '' : this.open ? 'mdi:chevron-up' : 'mdi:chevron-down'}></ha-icon>
</ha-icon-button>
<div class="fill-gap"></div>
${Object.values(this.config.buttons)
Expand Down
2 changes: 1 addition & 1 deletion src/const.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { localize } from './localize/localize';

export const CARD_VERSION = '5.9.2';
export const CARD_VERSION = '5.9.3';

export const states = {
status: {
Expand Down
16 changes: 16 additions & 0 deletions src/editor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,10 @@ export class BoilerplateCardEditor extends ScopedRegistryHost(LitElement) implem
return this._config?.show_buttons || false;
}

get _always_show_details(): boolean {
return this._config?.always_show_details || false;
}

get _show_toolbar(): boolean {
return this._config?.show_toolbar || false;
}
Expand Down Expand Up @@ -208,6 +212,18 @@ export class BoilerplateCardEditor extends ScopedRegistryHost(LitElement) implem
<U>${localize('editor.body_options')}</U>
</p><br>
${localize('editor.always_show_details')}<br>
<mwc-formfield class="option" .label=${localize(this._always_show_details
? 'editor.always_show_details_aria_label_off'
: 'editor.always_show_details_aria_label_on'
)}>
<mwc-switch
.checked=${this._always_show_details !== false}
.configValue=${'always_show_details'}
@change=${this._valueChanged}
></mwc-switch>
</mwc-formfield>
${localize('editor.show_toolbar')}<br>
<mwc-formfield class="option" .label=${localize(this._show_toolbar
? 'editor.show_toolbar_aria_label_off'
Expand Down
3 changes: 3 additions & 0 deletions src/localize/languages/cs.json
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,9 @@
"show_attributes": "Show hlavní osobní data (vpravo nahoře) ?",
"show_attributes_aria_label_on": "Zapnout zobrazování atributů",
"show_attributes_aria_label_off": "Vypnout zobrazování atributů",
"always_show_details": "Vždy zobrazovat detaily",
"always_show_details_aria_label_on": "Zapnout výchozí zobrazení podrobností",
"always_show_details_aria_label_off": "Vypnout výchozí zobrazení podrobností",
"show_toolbar": "Zobrazit pokročilá nastavení ?",
"show_toolbar_aria_label_on": "Zapnout zobrazení pokročilých nastavení",
"show_toolbar_aria_label_off": "Vypnout zobrazení pokročilých nastavení",
Expand Down
3 changes: 3 additions & 0 deletions src/localize/languages/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,9 @@
"show_attributes": "Persönliche Stammdaten anzeigen (rechts oben)?",
"show_attributes_aria_label_on": "Basis Daten einblenden (rechts oben) einschalten",
"show_attributes_aria_label_off": "Basis Daten einblenden (rechts oben) ausschalten",
"always_show_details": "Details immer anzeigen",
"always_show_details_aria_label_on": "Schalten Sie die standardmäßige Detailansicht ein",
"always_show_details_aria_label_off": "Schaltet die standardmäßige Detailansicht aus",
"show_toolbar": "Fortgeschrittene Optionen anzeigen ?",
"show_toolbar_aria_label_on": "Symbolleiste anzeigen einschalten",
"show_toolbar_aria_label_off": "Symbolleiste anzeigen ausschalten",
Expand Down
3 changes: 3 additions & 0 deletions src/localize/languages/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,9 @@
"show_attributes": "Show personal master data (top right)?",
"show_attributes_aria_label_on": "Toggle display attributes on",
"show_attributes_aria_label_off": "Toggle display attributes off",
"always_show_details": "Always show details",
"always_show_details_aria_label_on": "Toggle default detail view on",
"always_show_details_aria_label_off": "Toggle default detail view off",
"show_toolbar": "Show advanced options?",
"show_toolbar_aria_label_on": "Toggle display advanced options on",
"show_toolbar_aria_label_off": "Toggle display advanced options off",
Expand Down
3 changes: 3 additions & 0 deletions src/localize/languages/es.json
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,9 @@
"show_attributes": "¿Mostrar datos de perfil personal (esquina superior derecha)?",
"show_attributes_aria_label_on": "Mostrar atributos",
"show_attributes_aria_label_off": "Ocultar atributos",
"always_show_details": "Mostrar siempre los detalles",
"always_show_details_aria_label_on": "Mostrar la vista de detalles predeterminada",
"always_show_details_aria_label_off": "Ocultar la vista de detalles predeterminada",
"show_toolbar": "¿Mostrar opciones avanzadas?",
"show_toolbar_aria_label_on": "Mostrar opciones avanzadas",
"show_toolbar_aria_label_off": "Ocultar opciones avanzadas",
Expand Down
3 changes: 3 additions & 0 deletions src/localize/languages/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,9 @@
"show_attributes": "Afficher les données personnelles de base (en haut à droite) ?",
"show_attributes_aria_label_on": "Activer l'affichage des données personnelles de base",
"show_attributes_aria_label_off": "Désactiver l'affichage des données personnelles de base",
"always_show_details": "Toujours afficher les détails",
"always_show_details_aria_label_on": "Activer l'affichage des détails par défaut",
"always_show_details_aria_label_off": "Désactiver l'affichage des détails par défaut",
"show_toolbar": "Afficher les options avancées ?",
"show_toolbar_aria_label_on": "Activer l'affichage des options avancées",
"show_toolbar_aria_label_off": "Désactiver l'affichage des options avancées",
Expand Down
3 changes: 3 additions & 0 deletions src/localize/languages/it.json
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,9 @@
"show_attributes": "Mostrare i dati anagrafici personali (in alto a destra) ?",
"show_attributes_aria_label_on": "Attiva la visione degli attributi",
"show_attributes_aria_label_off": "Disattiva la visione degli attributi",
"always_show_details": "Mostra sempre i dettagli",
"always_show_details_aria_label_on": "Attiva la visualizzazione dettagliata predefinita",
"always_show_details_aria_label_off": "Disattiva la visualizzazione dettagliata predefinita",
"show_toolbar": "Mostrare opzioni avanzate ?",
"show_toolbar_aria_label_on": "Attiva opzioni avanzate",
"show_toolbar_aria_label_off": "Disattiva opzioni avanzate",
Expand Down
3 changes: 3 additions & 0 deletions src/localize/languages/nl.json
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,9 @@
"show_attributes": "Persoonlijke stamgegevens weergeven (rechtsboven) ?",
"show_attributes_aria_label_on": "Zet attributen aan",
"show_attributes_aria_label_off": "Zet attributen uit",
"always_show_details": "Toon altijd details",
"always_show_details_aria_label_on": "Zet standaard detailweergave aan",
"always_show_details_aria_label_off": "Zet standaard detailweergave uit",
"show_toolbar": "Toon geavanceerde opties ?",
"show_toolbar_aria_label_on": "Zet knoppenbalk aan",
"show_toolbar_aria_label_off": "Zet knoppenbalk uit",
Expand Down
3 changes: 3 additions & 0 deletions src/localize/languages/pl.json
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,9 @@
"show_attributes": "Show personal master data (gora po prawej)?",
"show_attributes_aria_label_on": "Toggle display attributes on",
"show_attributes_aria_label_off": "Toggle display attributes off",
"always_show_details": "Zawsze pokazuj szczegóły",
"always_show_details_aria_label_on": "Włącz domyślny widok szczegółów",
"always_show_details_aria_label_off": "Wyłącz domyślny widok szczegółów",
"show_toolbar": "Pokazać zaawansowane opcje?",
"show_toolbar_aria_label_on": "Włącz zaawansowane opcje",
"show_toolbar_aria_label_off": "Wyłącz zaawansowane opcje",
Expand Down
3 changes: 3 additions & 0 deletions src/localize/languages/pt-BR.json
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,9 @@
"show_attributes": "Mostrar dados mestres pessoais (canto superior direito) ?",
"show_attributes_aria_label_on": "Alternar atributos de exibição em",
"show_attributes_aria_label_off": "Alternar atributos de exibição fora",
"always_show_details": "Mostrar sempre detalhes",
"always_show_details_aria_label_on": "Alternar a visualização de detalhes padrão em",
"always_show_details_aria_label_off": "Alternar a visualização de detalhes padrão fora",
"show_toolbar": "Mostrar opções avançadas ?",
"show_toolbar_aria_label_on": "Alternar a barra de ferramentas do display em",
"show_toolbar_aria_label_off": "Alternar barra de ferramentas de exibição fora",
Expand Down
3 changes: 3 additions & 0 deletions src/localize/languages/pt.json
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,9 @@
"show_attributes": "Mostrar os dados do perfil pessoal (canto superior direito) ?",
"show_attributes_aria_label_on": "Mostrar atributos",
"show_attributes_aria_label_off": "Esconder atributos",
"always_show_details": "Mostrar sempre detalhes",
"always_show_details_aria_label_on": "Alternar a vista de detalhe por defeito em",
"always_show_details_aria_label_off": "Alternar a vista de detalhe por defeito",
"show_toolbar": "Mostrar opções avançadas ?",
"show_toolbar_aria_label_on": "Mostrar a barra de ferramentas",
"show_toolbar_aria_label_off": "Esconder a barra de ferramentas",
Expand Down
3 changes: 3 additions & 0 deletions src/localize/languages/ro.json
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,9 @@
"show_attributes": "Afișați datele de bază personale (dreapta sus)?",
"show_attributes_aria_label_on": "Activați/dezactivați atributele de afișare",
"show_attributes_aria_label_off": "Dezactivați atributele de afișare",
"always_show_details": "Afișați întotdeauna detalii",
"always_show_details_aria_label_on": "Activați vizualizarea implicită a detaliilor",
"always_show_details_aria_label_off": "Dezactivați vizualizarea implicită a detaliilor",
"show_toolbar": "Arată opțiuni avansate?",
"show_toolbar_aria_label_on": "Comutați afișarea opțiunilor avansate",
"show_toolbar_aria_label_off": "Dezactivați afișarea opțiunilor avansate",
Expand Down
3 changes: 3 additions & 0 deletions src/localize/languages/ru.json
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,9 @@
"show_attributes": "Отображение персональных данных",
"show_attributes_aria_label_on": "Отображать персональные данные",
"show_attributes_aria_label_off": "Не отображать персональные данные",
"always_show_details": "Всегда показывать детали",
"always_show_details_aria_label_on": "Постоянное отображение деталей",
"always_show_details_aria_label_off": "Не отображайте данные на постоянной основе",
"show_toolbar": "Отображение панели дополнительных параметров",
"show_toolbar_aria_label_on": "Отображать панель дополнительных параметров",
"show_toolbar_aria_label_off": "Не отображать панель дополнительных параметров",
Expand Down
3 changes: 3 additions & 0 deletions src/localize/languages/zh-Hans.json
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,9 @@
"show_attributes": "Show personal master data (top right) ?",
"show_attributes_aria_label_on": "Toggle display attributes on",
"show_attributes_aria_label_off": "Toggle display attributes off",
"always_show_details": "Always show details",
"always_show_details_aria_label_on": "Toggle default detail view on",
"always_show_details_aria_label_off": "Toggle default detail view off",
"show_toolbar": "Show advanced options ?",
"show_toolbar_aria_label_on": "Toggle display advanced options on",
"show_toolbar_aria_label_off": "Toggle display advanced options off",
Expand Down
4 changes: 2 additions & 2 deletions tracker.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"body-miscale-card": {
"updated_at": "2022-08-15",
"version": "v5.9.2",
"updated_at": "2023-01-14",
"version": "v5.9.3",
"remote_location": "https://raw.githubusercontent.com/dckiller51/lovelace-body-miscale-card/master/dist/body-miscale-card.js",
"visit_repo": "https://github.com/dckiller51/lovelace-body-miscale-card",
"changelog": "https://github.com/dckiller51/lovelace-body-miscale-card/blob/master/CHANGELOG.md"
Expand Down

0 comments on commit 68f0348

Please sign in to comment.