Skip to content
Open
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions docs/faq.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,9 +93,10 @@

??? question "How to reload the dashboard after installing a new version manually?"

Standard cache clears like CTRL+F5 often fail in Home Assistant due to its reliance on Service Workers.
A reboot or standard cache clears like CTRL+F5 often fail in Home Assistant due to its reliance on Service Workers.

To ensure a clean reload, open the Developer Tools (F12 for most browsers), enable 'Disable cache' in the Network
tab, and refresh the page twice to update all resources.
tab, and refresh the page at least twice to update all resources.

**Don't forget to re-enable the cache again when you're finished.**
The cache setting is constrained to the window/tab where the Developer Tools are open.
It does not affect other tabs or windows, and it does not affect your browser once you close the Developer Tools.
4 changes: 4 additions & 0 deletions docs/full-example.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@ strategy:
_:
hide_config_entities: true
stack_count: 1
default:
hidden_domains:
- automation
- script
light:
order: 10
stack_count: 2
Expand Down
2 changes: 1 addition & 1 deletion docs/getting-started/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ If you require testing a custom build for debug purposes, follow these steps:
!!! note

Refresh the cache of the client you use to access Home Assistant.
See the [FAQ](../faq.md) for instructions on desktop browers.
See the [FAQ](../faq.md) for instructions on desktop browsers.

## 🔄 Updating

Expand Down
34 changes: 27 additions & 7 deletions docs/options/domain-options.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,17 +32,37 @@ Each configuration is identified by a domain name and can have the following opt
| `hide_diagnostic_entities` | boolean | `true` | Set to `false` to include diagnostic-entities to the dashboard. |
| `order` | number | domain specific | Ordering position of the domain entities in a view. |
| `show_controls` | boolean | `true` | Whether to show controls in a view, to switch all entities of the domain. |
| `stack_count` | number | `1`<br>(set by `_`) | Cards per row.[^1] |
| `stack_count` | number | `1`<br>(set by `_`) | Cards per row. |
| `title` | string | domain specific | Title of the domain in a view. |

[^1]:
In the different views, the cards belonging to a specific domain will be horizontally stacked into a row.<br>
The number of cards per row can be configured with this option.

!!! note

* Domain `default` represents any other domain than supported by this strategy.
* The `show_controls` option will default to false for domains that can't be controlled.
- In the different domain views, the cards belonging to a specific domain will be horizontally stacked into a row.<br>
The number of cards per row can be configured with option `stack_count`.
- The `show_controls` option will fall back to `false` for domains that can't be controlled.

## Default domain

The `default` domain represents all other domains than supported by this strategy.

This domain has an additional option to hide domain-specific entities from the 'Miscellaneous' section of an Area view.

| Option | type | Default | Description |
|:-----------------|:------|:--------|:------------------------------------------------------------------------|
| `hidden_domains` | array | [] | A list of domains to hide in the Miscellaneoud sectiob of an Area view. |
Comment thread
DigiLive marked this conversation as resolved.
Outdated

Example to hide Automations and Scripts from the 'Miscellaneous' section of an Area view:

```yaml
strategy:
type: custom:mushroom-strategy
options:
domains:
default: # All other domains
hidden_domains:
- automation
- script
```

## Sorting Domains

Expand Down
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,9 @@
"json:format": "prettier --write \"**/*.json\"",
"md:lint": "markdownlint-cli2 \"**/*.md\" \"#node_modules\" \"#dist\"",
"md:lint:fix": "markdownlint-cli2 \"**/*.md\" \"#node_modules\" \"#dist\" --fix",
"docs:serve": "mkdocs serve",
"docs:serve-versioned": "mike serve",
"docs:install": "python -m venv venv && call venv/Scripts/activate.bat && pip install -r requirements.txt",
"docs:serve": "call venv/Scripts/activate.bat && mkdocs serve",
"docs:serve-versioned": "call venv/Scripts/activate.bat && mike serve",
Comment thread
DigiLive marked this conversation as resolved.
Outdated
"docs:list": "mike list",
"build-dev": "webpack --config webpack.dev.config.ts",
"build": "webpack",
Expand Down
4 changes: 4 additions & 0 deletions src/Registry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,10 @@ class Registry {
...Registry.strategyOptions.domains[domain],
};

if (Registry.strategyOptions.domains.default.hidden_domains.includes(entityDomain)) {
return false;
}

if (domainOptions.hide_config_entities && entity.entity_category === 'config') {
return false;
}
Expand Down
1 change: 1 addition & 0 deletions src/configurationDefaults.ts
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,7 @@ export const ConfigurationDefaults: StrategyConfig = {
title: localize('generic.miscellaneous'),
show_controls: false,
hidden: false,
hidden_domains: [],
},
},
extra_cards: [],
Expand Down
22 changes: 20 additions & 2 deletions src/types/strategy/strategy-generics.ts
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,18 @@ export interface SingleDomainConfig extends Partial<StrategyHeaderCardConfig> {
stack_count?: number;
}

/**
* Configuration for the default domain.
*
* The default domain contains entities whose domain is not explicitly supported by the strategy.
* Use `hidden_domains` to exclude specific unsupported domains from being displayed.
*
* @property {string[]} [hidden_domains] List of unsupported domains to hide.
Comment thread
DigiLive marked this conversation as resolved.
Outdated
*/
export interface DefaultDomainConfig extends SingleDomainConfig {
hidden_domains: string[];
}

/**
* Strategy Configuration.
*
Expand All @@ -212,7 +224,7 @@ export interface SingleDomainConfig extends Partial<StrategyHeaderCardConfig> {
* @property {Object.<string, CustomCardConfig>} card_options - Card options for entities.
* @property {BadgeConfig} badges - The configuration of badges in the Home view.
* @property {boolean} debug - If True, the strategy outputs more verbose debug information in the console.
* @property {Object.<string, AllDomainsConfig | SingleDomainConfig>} domains - List of domains.
* @property {Object} domains - List of domain configurations.
* @property {LovelaceCardConfig[]} extra_cards - List of cards to show below room cards.
* @property {StrategyViewConfig[]} extra_views - List of custom-defined views to add to the dashboard.
* @property {Object} home_view - Configuration for the home view.
Expand All @@ -231,7 +243,13 @@ export interface StrategyConfig {
card_options: { [S: string]: CustomCardConfig };
badges: BadgeConfig;
debug: boolean;
domains: { [K in SupportedDomains]: K extends '_' ? AllDomainsConfig : SingleDomainConfig };
domains: {
[K in SupportedDomains]: K extends '_'
? AllDomainsConfig
: K extends 'default'
? DefaultDomainConfig
: SingleDomainConfig;
};
extra_cards: LovelaceCardConfig[];
extra_views: StrategyViewConfig[];
home_view: {
Expand Down
Loading