From 6ed2f8d17a4d963c3bd9786bf046a7604223aec3 Mon Sep 17 00:00:00 2001 From: Nikolay Vasilchuk Date: Thu, 28 Dec 2023 11:54:25 +0300 Subject: [PATCH] Small fix --- dist/starline-card.js | 5 +++-- src/ts/StarlineCard.ts | 4 +++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/dist/starline-card.js b/dist/starline-card.js index 7ecfc6a..c52ea8f 100644 --- a/dist/starline-card.js +++ b/dist/starline-card.js @@ -1,6 +1,6 @@ /** * lovelace-starline-card v1.2.1 - * Tue, 26 Dec 2023 13:15:18 GMT + * Thu, 28 Dec 2023 08:54:08 GMT */ const STARLINE_ENTITIES = { 'battery': { @@ -708,7 +708,8 @@ class StarlineCard extends HTMLElement { visible = state !== null; if (state !== null && state !== data.value) { this._info[key].value = state; - const unit = this._getAttr(key, 'unit_of_measurement'); + const unit = key === 'gps' ? '' : + this._getAttr(key, 'unit_of_measurement'); this._info[key].element.querySelector('.info-i-cnt').textContent = `${state} ${unit}`; } } diff --git a/src/ts/StarlineCard.ts b/src/ts/StarlineCard.ts index 6156406..a054478 100644 --- a/src/ts/StarlineCard.ts +++ b/src/ts/StarlineCard.ts @@ -268,7 +268,9 @@ export class StarlineCard extends HTMLElement { if (state !== null && state !== data.value) { this._info[key].value = state; - const unit = this._getAttr(key, 'unit_of_measurement'); + // Не показываем 'satellites' для спутников + const unit = key === 'gps' ? '' : + this._getAttr(key, 'unit_of_measurement'); this._info[key].element!.querySelector('.info-i-cnt')!.textContent = `${state} ${unit}`; } }