@@ -484,18 +484,18 @@ const oe=e=>t=>"function"==typeof t?((e,t)=>(window.customElements.define(e,t),t
- `}renderName(e){return this.config.show_name?z`
${this.config.name||e.attributes.friendly_name}
`:z``}renderState(e){if(!this.config.show_states)return z``;const t=this.hass.states[this.config.entity],i=e&&e.key in t.attributes,o=e&&e.key in t,a=i?t.attributes[e.key]:o?t[e.key]:this.hass.localize("state.default.unavailable"),r=Lt(a,this.hass.locale),n=z`
+ `}renderName(e){return this.config.show_name?z`
${this.config.name||e.attributes.friendly_name}
`:z``}renderState(e){if(!this.config.show_states)return z``;const t=this.hass.states[this.config.entity],i=e&&e.key in t.attributes,o=e&&e.key in t,a=i?t.attributes[e.key]:o?t[e.key]:this.hass.localize("state.default.unavailable"),r=Qt(a,this.hass.locale),n=z`
${e.icon&&this.renderIcon(e)}
- ${(e.label||"")+(Et(`states.${a}`)||r)+(e.unit||"")}
+ ${(e.label||"")+(Rt(`states.${a}`)||r)+(e.unit||"")}
-
`;return`${e.key}_list`in t.attributes&&(i||o)?this.renderDropdown(n,e.key):n}renderAttribute(e){if(!this.config.show_attributes)return z``;const t=this.hass.states[this.config.entity],i=e.compute||(e=>e),o=e&&e.key in t.attributes,a=e&&e.key in t,r=o?i(t.attributes[e.key]):a?i(t[e.key]):this.hass.localize("state.default.unavailable"),n=Lt(r,this.hass.locale),s=z`
- ${e.icon&&this.renderIcon(e)}${(e.label||"")+(Et(`attributes_value.${r}`)||n)+(e.unit||"")}
-
`;return`${e.key}_list`in t.attributes&&(o||a)?this.renderDropdown(s,e.key):s}renderBody(e){if(!this.config.show_body)return z``;const t=this.hass.states[this.config.entity],i=e.compute||(e=>e),o=e&&e.key in t.attributes,a=e&&e.key in t,r=o?i(t.attributes[e.key]):a?i(t[e.key]):this.hass.localize("state.default.unavailable"),n=Lt(r,this.hass.locale);let s=30;e.height&&(s=e.height);let l,c,d,h,b,m,u,g,p="stretch",_="0px 0px 0px 13px",f="right",v="row",y="left",w="height: 100%; width: 2px;";switch(e.direction){case"right":f="right",y="left";break;case"up":_="0px",f="top",v="column-reverse",y="bottom",w="height: 2px; width: 100%;"}switch(e.positions.icon){case"outside":l=z`
${e.icon&&this.renderIconbody(e)} `;break;case"inside":c=z`
${e.icon&&this.renderIconbody(e)} `,_="0px";break;case"off":_="0px"}switch(e.positions.name){case"outside":d=z`
+
`;return`${e.key}_list`in t.attributes&&(i||o)?this.renderDropdown(n,e.key):n}renderAttribute(e){if(!this.config.show_attributes)return z``;const t=this.hass.states[this.config.entity],i=e.compute||(e=>e),o=e&&e.key in t.attributes,a=e&&e.key in t,r=o?i(t.attributes[e.key]):a?i(t[e.key]):this.hass.localize("state.default.unavailable"),n=Qt(r,this.hass.locale),s=z`
+ ${e.icon&&this.renderIcon(e)}${(e.label||"")+(Rt(`attributes_value.${r}`)||n)+(e.unit||"")}
+
`;return`${e.key}_list`in t.attributes&&(o||a)?this.renderDropdown(s,e.key):s}renderBody(e){if(!this.config.show_body)return z``;const t=this.hass.states[this.config.entity],i=e.compute||(e=>e),o=e&&e.key in t.attributes,a=e&&e.key in t,r=o?i(t.attributes[e.key]):a?i(t[e.key]):this.hass.localize("state.default.unavailable"),n=Qt(r,this.hass.locale);let s=30;e.height&&(s=e.height);let l,c,d,h,b,m,u,g,p="stretch",_="0px 0px 0px 13px",f="right",v="row",y="left",w="height: 100%; width: 2px;";switch(e.direction){case"right":f="right",y="left";break;case"up":_="0px",f="top",v="column-reverse",y="bottom",w="height: 2px; width: 100%;"}switch(e.positions.icon){case"outside":l=z`
${e.icon&&this.renderIconbody(e)} `;break;case"inside":c=z`
${e.icon&&this.renderIconbody(e)} `,_="0px";break;case"off":_="0px"}switch(e.positions.name){case"outside":d=z`
${e.label||""}t=>"function"==typeof t?((e,t)=>(window.customElements.define(e,t),t
${e.max+(e.unit||"")}
`}switch(e.positions.value){case"outside":u=z`
${(Et(`body_value.${r}`)||n)+(e.unit||"")}${(Rt(`body_value.${r}`)||n)+(e.unit||"")}
`;break;case"inside":g=z`
${(Et(`body_value.${r}`)||n)+(e.unit||"")}${(Rt(`body_value.${r}`)||n)+(e.unit||"")}
- `;break;case"off":_="0px"}const k=this._computeBarColor(e,Number(r)),x=this._computePercent(e,Number(r)),$=this._computePercent(e,e.target);let S=x,A=this._computePercent(e,e.target);A
+ `;break;case"off":_="0px"}const k=this._computeBarColor(e,Number(r)),x=this._computePercent(e,Number(r)),S=this._computePercent(e,e.target);let $=x,A=this._computePercent(e,e.target);A<$&&($=A,A=x);let I="";e.width&&(p="center",I=`width: ${e.width}`);let O="column";this.config.columns&&(O="row");const M=z`
${l} ${d}
t=>"function"==typeof t?((e,t)=>(window.customElements.define(e,t),t
>
${e.target?z`
`:""}
t=>"function"==typeof t?((e,t)=>(window.customElements.define(e,t),t
${b} ${u}
- `;return`${e.key}_list`in t.attributes&&(o||a)?this.renderDropdown(E,e.key):E}renderIcon(e){const t=this.hass.states[this.config.entity],i="water"===e.key&&"water_icon"in this.stateObj.attributes?this.stateObj.attributes.water_icon:e.icon;return"none"!==t.attributes.problem&&"mdi:alert"===i?z``:z``}renderIconbody(e){const t="Water"===e.key&&"water_icon"in this.stateObj.attributes?this.stateObj.attributes.water_icon:e.icon;return z``;return`${e.key}_list`in t.attributes&&(o||a)?this.renderDropdown(M,e.key):M}renderIcon(e){const t=this.hass.states[this.config.entity],i="water"===e.key&&"water_icon"in this.stateObj.attributes?this.stateObj.attributes.water_icon:e.icon;return"none"!==t.attributes.problem&&"mdi:alert"===i?z``:z``}renderIconbody(e){const t="Water"===e.key&&"water_icon"in this.stateObj.attributes?this.stateObj.attributes.water_icon:e.icon;return z``}renderButton(e){return this.config.show_buttons?e&&!1!==e.show?z`t=>"function"==typeof t?((e,t)=>(window.customElements.define(e,t),t
@@ -576,4 +576,4 @@ const oe=e=>t=>"function"==typeof t?((e,t)=>(window.customElements.define(e,t),t
${a.map((e=>z`${e}`))}
- `}static get styles(){return Rt}_computeBarColor(e,t){let i;return i=e.severity?this._computeSeverityColor(e,t):"unavailable"==e?`var(--score-card-disabled-color, ${e.color})`:e.color,i}_computeSeverityColor(e,t){const i=e.severity;let o;return isNaN(t)?i.forEach((t=>{e==t.text&&(o=t.color)})):i.forEach((e=>{t>=e.from&&t<=e.to&&(o=e.color)})),null==o&&(o=e.color),o}_computePercent(e,t){if("unavailable"==e)return 0;if(isNaN(t))return 100;switch(e.direction){case"right-reverse":case"left-reverse":case"up-reverse":case"down-reverse":return 100-100*(t-e.min)/(e.max-e.min);default:return 100*(t-e.min)/(e.max-e.min)}}_moreInfo(){we(this,"hass-more-info",{entityId:this.config.entity})}};e([re({attribute:!1})],Gt.prototype,"hass",void 0),e([ne()],Gt.prototype,"config",void 0),e([ne()],Gt.prototype,"_configArray",void 0),e([ne()],Gt.prototype,"open",void 0),Gt=e([oe("body-miscale-card")],Gt);export{Gt as BodyMiScaleCard};
+ `}static get styles(){return Ft}_computeBarColor(e,t){let i;return i=e.severity?this._computeSeverityColor(e,t):"unavailable"==e?`var(--score-card-disabled-color, ${e.color})`:e.color,i}_computeSeverityColor(e,t){const i=e.severity;let o;return isNaN(t)?i.forEach((t=>{e==t.text&&(o=t.color)})):i.forEach((e=>{t>=e.from&&t<=e.to&&(o=e.color)})),null==o&&(o=e.color),o}_computePercent(e,t){if("unavailable"==e)return 0;if(isNaN(t))return 100;switch(e.direction){case"right-reverse":case"left-reverse":case"up-reverse":case"down-reverse":return 100-100*(t-e.min)/(e.max-e.min);default:return 100*(t-e.min)/(e.max-e.min)}}_moreInfo(){we(this,"hass-more-info",{entityId:this.config.entity})}};e([re({attribute:!1})],ei.prototype,"hass",void 0),e([ne()],ei.prototype,"config",void 0),e([ne()],ei.prototype,"_configArray",void 0),e([ne()],ei.prototype,"open",void 0),ei=e([oe("body-miscale-card")],ei);export{ei as BodyMiScaleCard};
diff --git a/src/localize/languages/it.json b/src/localize/languages/it.json
new file mode 100644
index 0000000..443655a
--- /dev/null
+++ b/src/localize/languages/it.json
@@ -0,0 +1,113 @@
+{
+ "common": {
+ "version": "Versione",
+ "name": "BodyMiScale Card",
+ "description": "La card bodymiscale ti mostra il tuo peso/stato corporeo relativo.",
+ "not_available": "BodyMiScale non è disponibile",
+ "toggle_power": "Più dettagli come BMI kCal mostra / nascondi"
+ },
+ "states": {
+ "ok": "MISURAZIONE: OK",
+ "unknown": "STATO: sconosciuto",
+ "problem": "Problema",
+ "none": "Nessuno",
+ "weight unavailable": "Peso non disponibile",
+ "impedance unavailable": "Impedenza non disponibile",
+ "weight unavailable, impedance unavailable": "Peso non disponibile, impedenza non disponibile",
+ "weight low": "Peso basso",
+ "impedance low": "Impedenza bassa",
+ "weight low, impedance low": "Peso basso, impedenza bassa",
+ "weight high": "Peso alto",
+ "impedance high": "Impedenza alta",
+ "weight high, impedance high": "Peso alto, impedenza alta",
+ "weight high, impedance low": "Peso alto, impedenza bassa",
+ "weight low, impedance high": "Peso basso, impedenza alta"
+ },
+ "attributes": {
+ "weight: ": "Peso: ",
+ "impedance: ": "Impedenza: ",
+ "height: ": "Altezza: ",
+ "age: ": "Età: ",
+ "gender: ": "Sesso: "
+ },
+ "attributes_value": {
+ "male": "uomo",
+ "female": "donna",
+ "unavailable kg": "non disponibile",
+ "unavailable ohm": "non disponibile"
+ },
+ "body": {
+ "bmi": "BMI",
+ "bmi_label": "BMI Categoria",
+ "visceral_fat": "Grasso viscerale",
+ "body_fat": "Grasso corporeo",
+ "protein": "Proteine",
+ "water": "Acqua",
+ "muscle_mass": "Massa muscolare",
+ "bone_mass": "Massa ossea",
+ "weight": "Peso",
+ "ideal": "Ideale",
+ "basal_metabolism": "Metabolismo base",
+ "body_type": "Tipo di corpo",
+ "metabolic_age": "Età metabolica"
+ },
+ "body_value": {
+ "Skinny": "Magro",
+ "Balanced-skinny": "Bilanciato-magro",
+ "Skinny-muscular": "Magro-muscoloso",
+ "Balanced": "Bilanciato",
+ "Balanced-muscular": "Bilanciato-muscoloso",
+ "Lack-exercise": "Manca-esercizio",
+ "Thick-set": "Spesso-impostato",
+ "Obese": "Obeso",
+ "Overweight": "Sovrappeso",
+ "Underweight": "Sottopeso",
+ "Normal or Healthy Weight": "Normale o Peso Sano",
+ "Slight overweight": "Leggermente in sovrappeso",
+ "Moderate obesity": "Obesità Moderata",
+ "Severe obesity": "Obesità Grave",
+ "Massive obesity": "Obesità Massiccia"
+ },
+ "unit": {
+ " years": " anni"
+ },
+ "error": {
+ "missing_entity": "Perfavore definisci un'entità.",
+ "missing_entity_bodymiscale": "Perfavore definisci un'entità di tipo bodymiscale."
+ },
+ "editor": {
+ "entity": "Perfavore seleziona un account sulla bilancia (richiesto) !",
+ "image": "Immagine di sfondo (opzionale)",
+ "model": "ATTIVA solo se la bilancia ha i 4 cerchi grigi di 5 cm Ø sulla parte superiore",
+ "model1": "( = modello 181B) !",
+ "model_aria_label_on": "Attiva l'impedenza",
+ "model_aria_label_off": "Disattiva l'impedenza",
+ "unit": "Converti da kg a lbs",
+ "unit_aria_label_on": "Attiva la conversione",
+ "unit_aria_label_off": "Disattiva la conversione",
+ "show_name": "Mostrare il nome dell'account come titolo ?",
+ "show_name_aria_label_on": "Attiva la visione del nome",
+ "show_name_aria_label_off": "Disattiva la visione del nome",
+ "show_states": "Mostrare lo Stato ?",
+ "show_states_aria_label_on": "Attiva la visione dello stato",
+ "show_states_aria_label_off": "Disattiva la visione dello stato",
+ "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",
+ "show_toolbar": "Mostrare opzioni avanzate ?",
+ "show_toolbar_aria_label_on": "Attiva opzioni avanzate",
+ "show_toolbar_aria_label_off": "Disattiva opzioni avanzate",
+ "show_body": "Offrire ulteriori dettagli di misurazione",
+ "show_body1": "(metà inferiore - l'icona con la spunta ve li mostrerà) ?",
+ "show_body_aria_label_on": "Attiva la visione del punteggio del corpo",
+ "show_body_aria_label_off": "Disattiva la visione del punteggio del corpo",
+ "show_buttons": "Consenti il cambio di account ?",
+ "show_buttons_aria_label_on": "Attiva la visione dei pulsanti",
+ "show_buttons_aria_label_off": "Disattiva la visione dei pulsanti",
+ "code_information": "I CAMBIAMENTI APPARIRANNO SOLO DOPO AVER SALVATO LA CONFIGURAZIONE.",
+ "header_options": "1. Opzioni di intestazione della card",
+ "body_options": "2. Ulteriori opzioni della card",
+ "warning": "ATTENZIONE:",
+ "code_only_note": "Le opzioni aggiuntive sono disponibili solo nella modalità editor di codice."
+ }
+}
\ No newline at end of file
diff --git a/src/localize/localize.ts b/src/localize/localize.ts
index ccdc909..05f728a 100644
--- a/src/localize/localize.ts
+++ b/src/localize/localize.ts
@@ -1,6 +1,7 @@
import * as de from './languages/de.json';
import * as en from './languages/en.json';
import * as fr from './languages/fr.json';
+import * as it from './languages/it.json';
import * as nl from './languages/nl.json';
import * as pt_BR from './languages/pt-BR.json';
import * as zh_Hans from './languages/zh-Hans.json';
@@ -10,6 +11,7 @@ const languages: any = {
de: de,
en: en,
fr: fr,
+ it: it,
nl: nl,
pt_BR: pt_BR,
zh_Hans: zh_Hans,
diff --git a/tracker.json b/tracker.json
index 158032a..9d201cc 100644
--- a/tracker.json
+++ b/tracker.json
@@ -1,7 +1,7 @@
{
"body-miscale-card": {
- "updated_at": "2021-09-17",
- "version": "v5.6.4",
+ "updated_at": "2021-10-02",
+ "version": "v5.6.5",
"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"