forked from DigiLive/mushroom-strategy
Fix unwanted split in the Home view
HASS "masonry" view split the cards into multiple columns if sections get "too large". This change will force the default sections into a single vertical stack, while the extra_cards section is allowed to be moved by HASS.
This commit is contained in:
@ -26,16 +26,6 @@ class HomeView extends AbstractView {
|
|||||||
/** The domain of the entities that the view is representing. */
|
/** The domain of the entities that the view is representing. */
|
||||||
static readonly domain = 'home' as const;
|
static readonly domain = 'home' as const;
|
||||||
|
|
||||||
/** Returns the default configuration object for the view. */
|
|
||||||
static getDefaultConfig(): ViewConfig {
|
|
||||||
return {
|
|
||||||
title: localize('generic.home'),
|
|
||||||
icon: 'mdi:home-assistant',
|
|
||||||
path: 'home',
|
|
||||||
subview: false,
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class constructor.
|
* Class constructor.
|
||||||
*
|
*
|
||||||
@ -47,6 +37,16 @@ class HomeView extends AbstractView {
|
|||||||
this.baseConfiguration = { ...this.baseConfiguration, ...HomeView.getDefaultConfig(), ...customConfiguration };
|
this.baseConfiguration = { ...this.baseConfiguration, ...HomeView.getDefaultConfig(), ...customConfiguration };
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** Returns the default configuration object for the view. */
|
||||||
|
static getDefaultConfig(): ViewConfig {
|
||||||
|
return {
|
||||||
|
title: localize('generic.home'),
|
||||||
|
icon: 'mdi:home-assistant',
|
||||||
|
path: 'home',
|
||||||
|
subview: false,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create the configuration of the cards to include in the view.
|
* Create the configuration of the cards to include in the view.
|
||||||
*
|
*
|
||||||
@ -116,7 +116,12 @@ class HomeView extends AbstractView {
|
|||||||
homeViewCards.push(...Registry.strategyOptions.extra_cards);
|
homeViewCards.push(...Registry.strategyOptions.extra_cards);
|
||||||
}
|
}
|
||||||
|
|
||||||
return homeViewCards;
|
return [
|
||||||
|
{
|
||||||
|
type: 'vertical-stack',
|
||||||
|
cards: homeViewCards,
|
||||||
|
},
|
||||||
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Reference in New Issue
Block a user