diff --git a/README.md b/README.md index 0225038..f43fd2c 100644 --- a/README.md +++ b/README.md @@ -42,16 +42,17 @@ If you don't use HACS please change the url accordingly. ## Configuration -| Name | Type | Default | Description | -| ------------- | ------ | ------------------ | ----------------------------------------------------------------------- | -| type | string | **Required** | `custom:rpi-monitor-card` | -| entity | string | **Required** | Entity State | -| name | string | none | Overrides default title of the card. (Default: RPi Monitor {FQDN}) | -| name_prefix | string | 'RPi monitor' | Overrides default name prefix(Default: 'RPi Monitor') | -| card_style | string | 'glance' or 'full' | Card layout desired for this RPi. (Default is full) | -| temp_scale | string | 'C' or 'F' | Show Temperature in Celsius (C) or Fahrenheit (F). (Default is C) | -| fs_severity | object | none | A list of severity values. See [Severity Coloring](#severity-coloring). | -| temp_severity | object | none | A list of severity values. See [Severity Coloring](#severity-coloring). | +| Name | Type | Default | Description | +| ------------- | ------- | ------------------ | ----------------------------------------------------------------------- | +| type | string | **Required** | `custom:rpi-monitor-card` | +| entity | string | **Required** | Entity State | +| name | string | none | Overrides default title of the card. (Default: RPi Monitor {FQDN}) | +| name_prefix | string | 'RPi monitor' | Overrides default name prefix(Default: 'RPi Monitor') | +| card_style | string | 'glance' or 'full' | Card layout desired for this RPi. (Default is full) | +| temp_scale | string | 'C' or 'F' | Show Temperature in Celsius (C) or Fahrenheit (F). (Default is C) | +| fs_severity | object | none | A list of severity values. See [Severity Coloring](#severity-coloring). | +| temp_severity | object | none | A list of severity values. See [Severity Coloring](#severity-coloring). | +| show_title | boolean | true | Show / hide the Title for this card. (Default is show - 'true') | ### Threashold Monitoring diff --git a/info.md b/info.md index 4481a03..380030e 100644 --- a/info.md +++ b/info.md @@ -34,16 +34,17 @@ If you don't use HACS please change the url accordingly. ## Configuration -| Name | Type | Default | Description | -| ------------- | ------ | ------------------ | ----------------------------------------------------------------------- | -| type | string | **Required** | `custom:rpi-monitor-card` | -| entity | string | **Required** | Entity State | -| name | string | none | Overrides default title of the card. (Default: RPi Monitor {FQDN}) | -| name_prefix | string | 'RPi monitor' | Overrides default name prefix(Default: 'RPi Monitor') | -| card_style | string | 'glance' or 'full' | Card layout desired for this RPi. (Default is full) | -| temp_scale | string | 'C' or 'F' | Show Temperature in Celsius (C) or Fahrenheit (F). (Default is C) | -| fs_severity | object | none | A list of severity values. See [Severity Coloring](#severity-coloring). | -| temp_severity | object | none | A list of severity values. See [Severity Coloring](#severity-coloring). | +| Name | Type | Default | Description | +| ------------- | ------- | ------------------ | ----------------------------------------------------------------------- | +| type | string | **Required** | `custom:rpi-monitor-card` | +| entity | string | **Required** | Entity State | +| name | string | none | Overrides default title of the card. (Default: RPi Monitor {FQDN}) | +| name_prefix | string | 'RPi monitor' | Overrides default name prefix(Default: 'RPi Monitor') | +| card_style | string | 'glance' or 'full' | Card layout desired for this RPi. (Default is full) | +| temp_scale | string | 'C' or 'F' | Show Temperature in Celsius (C) or Fahrenheit (F). (Default is C) | +| fs_severity | object | none | A list of severity values. See [Severity Coloring](#severity-coloring). | +| temp_severity | object | none | A list of severity values. See [Severity Coloring](#severity-coloring). | +| show_title | boolean | true | Show / hide the Title for this card. (Default is show - 'true') | ### Threashold Monitoring diff --git a/src/const.ts b/src/const.ts index f1dbe71..8697736 100644 --- a/src/const.ts +++ b/src/const.ts @@ -1,4 +1,4 @@ -export const CARD_VERSION = '1.2.4'; +export const CARD_VERSION = '1.2.5'; /* * EXAMPLE attributes diff --git a/src/rpi-monitor-card.ts b/src/rpi-monitor-card.ts index c562ace..f3f9040 100644 --- a/src/rpi-monitor-card.ts +++ b/src/rpi-monitor-card.ts @@ -363,9 +363,19 @@ export class RPiMonitorCard extends LitElement { const rpi_fqdn = this._getAttributeValueForKey(Constants.RPI_FQDN_KEY); let cardName = 'RPi monitor ' + rpi_fqdn; + cardName = this._config.name_prefix != undefined ? this._config.name_prefix + ' ' + rpi_fqdn : cardName; cardName = this._config.name != undefined ? this._config.name : cardName; + const showCardName = this._config.show_title != undefined ? this._config.show_title : true; + if (showCardName == false) { + cardName = ''; + } + + const last_heard_full_class = showCardName == false ? 'last-heard-full-notitle' : 'last-heard-full'; + + const last_heard_class = showCardName == false ? 'last-heard-notitle' : 'last-heard'; + const card_timestamp_value = this._getRelativeTimeSinceUpdate(); if (this._useFullCard()) { @@ -385,7 +395,7 @@ export class RPiMonitorCard extends LitElement { >