Skip to content

Commit 7205d60

Browse files
committed
Refactor area title naming convention
Updated the naming convention for the 'areasTitle' property for consistency across the codebase.
1 parent fd57249 commit 7205d60

File tree

6 files changed

+8
-6
lines changed

6 files changed

+8
-6
lines changed

docs/full-example.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ strategy:
1414
home_view:
1515
hidden:
1616
greeting: false
17-
areasTitle: true
17+
areas_title: true
1818
stack_count:
1919
areas: [2, 1]
2020
persons: 3

docs/options/home-view-options.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ The `home_view` group enables you to specify the configuration of the Home view.
1414
The following sections can be hidden from the Home view:
1515

1616
- areas
17-
- areasTitle
17+
- areas_title
1818
- badges
1919
- greeting
2020
- persons
@@ -28,7 +28,7 @@ strategy:
2828
home_view:
2929
hidden:
3030
greeting: false
31-
areasTitle: true
31+
areas_title: true
3232
```
3333
3434
---

src/configurationDefaults.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ export const ConfigurationDefaults: StrategyDefaults = {
173173
home_view: {
174174
hidden: {
175175
areas: false,
176-
areasTitle: false,
176+
areas_title: false,
177177
badges: false,
178178
greeting: true,
179179
persons: false,

src/mushroom-strategy.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,8 @@ class MushroomStrategy extends HTMLTemplateElement {
7373

7474
// Extra views
7575
if (Registry.strategyOptions.extra_views) {
76+
views.push(...Registry.strategyOptions.extra_views);
77+
7678
views.sort((a, b) => {
7779
const diff = (a.order ?? Infinity) - (b.order ?? Infinity);
7880

src/types/strategy/strategy-generics.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ const SUPPORTED_BADGES = ['light', 'fan', 'cover', 'switch', 'climate', 'weather
7272
* This constant array defines the sections that are present in the home view.
7373
*/
7474
// eslint-disable-next-line @typescript-eslint/no-unused-vars
75-
const HOME_VIEW_SECTIONS = ['areas', 'areasTitle', 'badges', 'greeting', 'persons'] as const;
75+
const HOME_VIEW_SECTIONS = ['areas', 'areas_title', 'badges', 'greeting', 'persons'] as const;
7676

7777
export type SupportedDomains = (typeof SUPPORTED_DOMAINS)[number];
7878
export type SupportedViews = (typeof SUPPORTED_VIEWS)[number];

src/views/HomeView.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,7 @@ class HomeView extends AbstractView {
245245
return;
246246
}
247247

248-
const titleHidden = Registry.strategyOptions.home_view.hidden.areasTitle;
248+
const titleHidden = Registry.strategyOptions.home_view.hidden.areas_title;
249249

250250
if (titleHidden) {
251251
logMessage(lvlInfo, 'Greeting titleHidden is hidden.');

0 commit comments

Comments
 (0)