Skip to content

Commit

Permalink
feature: hide secondary_info option (#96)
Browse files Browse the repository at this point in the history
  • Loading branch information
regevbr authored Sep 27, 2022
1 parent 4eec2f4 commit f0eaced
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 8 deletions.
4 changes: 0 additions & 4 deletions .github/workflows/hacs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,6 @@ name: Hacs Validation
on:
push:
branches: ['*']
pull_request:
branches: ['*']
schedule:
- cron: '0 0 * * *'

jobs:
validate:
Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ v2 is only compatible from version 2022.3 onwards
| **secondary_info** | object | optional | v1.1.0 | secondary_info config. [secondary info examples](#secondary-info)
| secondary_info: `type` | string | optional | v1.1.0 | available types: `last-changed, last-updated (v2.2.0), fan-mode, fan-mode-dropdown, hvac-mode, hvac-action`
| secondary_info: `icon` | string | optional | v1.1.0 | icon for types: `fan-mode, fan-mode-dropdown, hvac-mode`, `hvac-action`
| secondary_info: `hide` | boolean | optional | v2.3.0 | hide secondary_info, default value `False`
| secondary_info: `source` | object | optional | v1.2.1 | source available types: `hvac-action`
| secondary_info: `source:{item_name}` | object | optional | v1.2.1 | source item name
| secondary_info: `source:{item_name}:icon` | object | optional | v1.2.1 | Specify a custom icon from any of the available mdi icons.
Expand All @@ -110,7 +111,7 @@ v2 is only compatible from version 2022.3 onwards
| hvac_mode: `style` | function | optional | v1.0.1 | custom style
| hvac_mode: `change_action` | function | optional | v1.0.1 | custom hvac_mode change function
| hvac_mode: `state` | object | optional | v1.0.1 | config to get hvac_mode state.
| hvac_mode: `hide` | number | optional | v1.2.3 | hide hvac_mode, default value `False`
| hvac_mode: `hide` | boolean | optional | v1.2.3 | hide hvac_mode, default value `False`
| hvac_mode: `state:entity` | string | optional | v1.1.0 | hvac_mode entity_id.
| hvac_mode: `state:attribute` | string | optional | v1.1.0 | hvac_mode attribute.
| hvac_mode: `state:mapper` | function | optional | v1.1.0 | state processing function
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "mini-climate-card",
"version": "v2.2.1",
"version": "v2.3.0",
"description": "a/c card for Home Assistant Lovelace UI",
"keywords": [
"home-assistant",
Expand Down
5 changes: 5 additions & 0 deletions release_notes/v2.3.0.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
## v2.3.0
[![Downloads](https://img.shields.io/github/downloads/artem-sedykh/mini-climate-card/v2.3.0/total.svg)](/~https://github.com/artem-sedykh/mini-climate-card/releases/tag/v2.3.0)

### Added
- feature: hide secondary_info option by @regevbr
4 changes: 2 additions & 2 deletions src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -608,8 +608,8 @@ class MiniClimate extends ScopedRegistryHost(LitElement) {
}

renderSecondaryInfo() {
if (this.climate.isUnavailable)
return '';
if (this.climate.isUnavailable || this.config.secondary_info.hide)
return html``;

return html`
<div class='entity__secondary_info ellipsis'>
Expand Down

0 comments on commit f0eaced

Please sign in to comment.