From b089170ef4e3b8ddb64328cf4ec9dc05ca629ebb Mon Sep 17 00:00:00 2001 From: basbruss <68892092+basbruss@users.noreply.github.com> Date: Fri, 27 May 2022 19:18:40 +0200 Subject: [PATCH 1/3] basis for python alterations --- .../ui_lovelace_minimalist/base.py | 3 ++ .../ui_lovelace_minimalist/config_flow.py | 15 ++++++++++ .../ui_lovelace_minimalist/configure.py | 28 ++++++++++++++----- .../ui_lovelace_minimalist/const.py | 3 ++ .../ui_lovelace_minimalist/load_dashboard.py | 19 +++++++++++++ .../lovelace/advanced-dash/test.yaml | 13 +++++++++ .../translations/en.json | 6 ++++ 7 files changed, 80 insertions(+), 7 deletions(-) create mode 100644 custom_components/ui_lovelace_minimalist/lovelace/advanced-dash/test.yaml diff --git a/custom_components/ui_lovelace_minimalist/base.py b/custom_components/ui_lovelace_minimalist/base.py index d0d69097a..72d53ad2e 100644 --- a/custom_components/ui_lovelace_minimalist/base.py +++ b/custom_components/ui_lovelace_minimalist/base.py @@ -26,6 +26,9 @@ class UlmConfiguration: sidepanel_enabled: bool = DEFAULT_SIDEPANEL_ENABLED sidepanel_icon: str = DEFAULT_SIDEPANEL_ICON sidepanel_title: str = DEFAULT_SIDEPANEL_TITLE + advanced_enabled: bool = DEFAULT_SIDEPANEL_ENABLED + advanced_icon: str = DEFAULT_SIDEPANEL_ICON + advanced_title: str = DEFAULT_SIDEPANEL_TITLE theme_path: str = DEFAULT_THEME_PATH theme: str = DEFAULT_THEME plugin_path: str = "www/community/" diff --git a/custom_components/ui_lovelace_minimalist/config_flow.py b/custom_components/ui_lovelace_minimalist/config_flow.py index 11340f798..c21268a45 100644 --- a/custom_components/ui_lovelace_minimalist/config_flow.py +++ b/custom_components/ui_lovelace_minimalist/config_flow.py @@ -13,6 +13,9 @@ CONF_INCLUDE_OTHER_CARDS, CONF_LANGUAGE, CONF_LANGUAGES, + CONF_SIDEPANEL_ADV_ENABLED, + CONF_SIDEPANEL_ADV_ICON, + CONF_SIDEPANEL_ADV_TITLE, CONF_SIDEPANEL_ENABLED, CONF_SIDEPANEL_ICON, CONF_SIDEPANEL_TITLE, @@ -54,6 +57,18 @@ def ulm_config_option_schema(options: dict = {}) -> dict: CONF_SIDEPANEL_ICON, default=options.get(CONF_SIDEPANEL_ICON, DEFAULT_SIDEPANEL_ICON), ): str, + vol.Optional( + CONF_SIDEPANEL_ADV_ENABLED, + default=options.get(CONF_SIDEPANEL_ADV_ENABLED, DEFAULT_SIDEPANEL_ENABLED), + ): bool, + vol.Optional( + CONF_SIDEPANEL_ADV_TITLE, + default=options.get(CONF_SIDEPANEL_ADV_TITLE, DEFAULT_SIDEPANEL_TITLE), + ): str, + vol.Optional( + CONF_SIDEPANEL_ADV_ICON, + default=options.get(CONF_SIDEPANEL_ADV_ICON, DEFAULT_SIDEPANEL_ICON), + ): str, vol.Optional( CONF_THEME, default=options.get(CONF_THEME, DEFAULT_THEME) ): vol.In(CONF_THEME_OPTIONS), diff --git a/custom_components/ui_lovelace_minimalist/configure.py b/custom_components/ui_lovelace_minimalist/configure.py index 34409a8a8..fca0b4d9c 100644 --- a/custom_components/ui_lovelace_minimalist/configure.py +++ b/custom_components/ui_lovelace_minimalist/configure.py @@ -56,13 +56,27 @@ def configure_cards(hass: HomeAssistant, ulm: UlmBase): language = LANGUAGES[ulm.configuration.language] # Copy example dashboard file over to user config dir if not exists - if not os.path.exists(hass.config.path(f"{DOMAIN}/dashboard/ui-lovelace.yaml")): - shutil.copy2( - hass.config.path( - f"custom_components/{DOMAIN}/lovelace/ui-lovelace.yaml" - ), - hass.config.path(f"{DOMAIN}/dashboard/ui-lovelace.yaml"), - ) + if ulm.configuration.sidepanel_enabled: + if not os.path.exists( + hass.config.path(f"{DOMAIN}/dashboard/ui-lovelace.yaml") + ): + shutil.copy2( + hass.config.path( + f"custom_components/{DOMAIN}/lovelace/ui-lovelace.yaml" + ), + hass.config.path(f"{DOMAIN}/dashboard/ui-lovelace.yaml"), + ) + # Copy advanced dashboard if not exists and is selected as option + if ulm.configuration.advanced_enabled: + if not os.path.exists( + hass.config.path(f"{DOMAIN}/dashboard/advanced-dash") + ): + shutil.copytree( + hass.config.path( + f"custom_components/{DOMAIN}/lovelace/advanced-dash" + ), + hass.config.path(f"{DOMAIN}/dashboard/advanced-dash"), + ) # Copy chosen language file over to config dir shutil.copy2( hass.config.path( diff --git a/custom_components/ui_lovelace_minimalist/const.py b/custom_components/ui_lovelace_minimalist/const.py index 2badd1cad..2cf481c01 100644 --- a/custom_components/ui_lovelace_minimalist/const.py +++ b/custom_components/ui_lovelace_minimalist/const.py @@ -31,6 +31,9 @@ CONF_SIDEPANEL_ENABLED = "sidepanel_enabled" CONF_SIDEPANEL_TITLE = "sidepanel_title" CONF_SIDEPANEL_ICON = "sidepanel_icon" +CONF_SIDEPANEL_ADV_ENABLED = "advanced_enabled" +CONF_SIDEPANEL_ADV_TITLE = "advanced_title" +CONF_SIDEPANEL_ADV_ICON = "advanced_icon" CONF_THEME = "theme" CONF_THEME_PATH = "theme_path" CONF_THEME_OPTIONS = [ diff --git a/custom_components/ui_lovelace_minimalist/load_dashboard.py b/custom_components/ui_lovelace_minimalist/load_dashboard.py index 2e2a5ad43..421fa3f97 100644 --- a/custom_components/ui_lovelace_minimalist/load_dashboard.py +++ b/custom_components/ui_lovelace_minimalist/load_dashboard.py @@ -27,6 +27,15 @@ def load_dashboard(hass: HomeAssistant, ulm: UlmBase): "require_admin": False, } + adv_dashboard_url = "advanced-dash" + adv_dashboard_config = { + "mode": "yaml", + "icon": ulm.configuration.advanced_icon, + "title": ulm.configuration.advanced_title, + "filename": "ui_lovelace_minimalist/dashboard/advanced-dash/test.yaml", + "show_in_sidebar": True, + "require_admin": False, + } # Optoinal override can be done with config_flow? # if not dashboard_url in hass.data["lovelace"]["dashboards"]: if ulm.configuration.sidepanel_enabled: @@ -38,3 +47,13 @@ def load_dashboard(hass: HomeAssistant, ulm: UlmBase): else: if dashboard_url in hass.data["lovelace"]["dashboards"]: async_remove_panel(hass, "ui-lovelace-minimalist") + + if ulm.configuration.advanced_enabled: + hass.data["lovelace"]["dashboards"][adv_dashboard_url] = LovelaceYAML( + hass, adv_dashboard_url, adv_dashboard_config + ) + + _register_panel(hass, adv_dashboard_url, "yaml", adv_dashboard_config, True) + else: + if adv_dashboard_url in hass.data["lovelace"]["dashboards"]: + async_remove_panel(hass, "ui-lovelace-minimalist") diff --git a/custom_components/ui_lovelace_minimalist/lovelace/advanced-dash/test.yaml b/custom_components/ui_lovelace_minimalist/lovelace/advanced-dash/test.yaml new file mode 100644 index 000000000..011a7df0d --- /dev/null +++ b/custom_components/ui_lovelace_minimalist/lovelace/advanced-dash/test.yaml @@ -0,0 +1,13 @@ +--- +# this is a test file +button_card_templates: !include_dir_merge_named "../../../custom_components/ui_lovelace_minimalist/__ui_minimalist__/ulm_templates/" + +title: "UI Lovelace Minimalist" +theme: "minimalist-desktop" +background: "var(--background-image)" +# views: !include_dir_merge_list "views/" +views: + - title: "Example View" + path: 0 + icon: "mdi:flower" + cards: diff --git a/custom_components/ui_lovelace_minimalist/translations/en.json b/custom_components/ui_lovelace_minimalist/translations/en.json index 97d0efbf7..e3870fd08 100644 --- a/custom_components/ui_lovelace_minimalist/translations/en.json +++ b/custom_components/ui_lovelace_minimalist/translations/en.json @@ -10,6 +10,9 @@ "sidepanel_enabled": "Enable creation of a Dashboard entry in the Side panel.", "sidepanel_icon": "Side panel icon", "sidepanel_title": "Side panel title", + "advanced_enabled": "Enable advanced Dashboard with popup splitview", + "advanced_title": "Advanced panel title", + "advanced_icon": "Advanced panel icon", "theme": "Theme", "include_other_cards": "Include custom card resources it's depending on." } @@ -30,6 +33,9 @@ "sidepanel_enabled": "Enable creation of a Dashboard entry in the Side panel.", "sidepanel_icon": "Side panel icon", "sidepanel_title": "Side panel title", + "advanced_enabled": "Enable advanced Dashboard with popup splitview", + "advanced_title": "Advanced panel title", + "advanced_icon": "Advanced panel icon", "theme": "Theme", "include_other_cards": "Include custom card resources it's depending on." } From f5ce97b5a9ffdffa7ba35a3b8350fc74fef94dbd Mon Sep 17 00:00:00 2001 From: basbruss <68892092+basbruss@users.noreply.github.com> Date: Mon, 30 May 2022 09:20:52 +0200 Subject: [PATCH 2/3] Backend framework --- .../ui_lovelace_minimalist/base.py | 6 +-- .../ui_lovelace_minimalist/configure.py | 2 +- .../ui_lovelace_minimalist/const.py | 6 +-- .../ui_lovelace_minimalist/load_dashboard.py | 10 ++-- .../{test.yaml => advanced-ui.yaml} | 0 .../lovelace/advanced-dash/popup/popup.yaml | 0 .../lovelace/advanced-dash/views/main.yaml | 0 .../translations/cs.json | 6 +++ .../translations/de.json | 6 +++ .../translations/en.json | 12 ++--- .../translations/it.json | 6 +++ .../translations/nl.json | 49 +++++++++++++++++++ .../translations/pl.json | 6 +++ .../translations/ru.json | 6 +++ .../translations/sk.json | 6 +++ 15 files changed, 103 insertions(+), 18 deletions(-) rename custom_components/ui_lovelace_minimalist/lovelace/advanced-dash/{test.yaml => advanced-ui.yaml} (100%) create mode 100644 custom_components/ui_lovelace_minimalist/lovelace/advanced-dash/popup/popup.yaml create mode 100644 custom_components/ui_lovelace_minimalist/lovelace/advanced-dash/views/main.yaml create mode 100644 custom_components/ui_lovelace_minimalist/translations/nl.json diff --git a/custom_components/ui_lovelace_minimalist/base.py b/custom_components/ui_lovelace_minimalist/base.py index 72d53ad2e..a58f2ed15 100644 --- a/custom_components/ui_lovelace_minimalist/base.py +++ b/custom_components/ui_lovelace_minimalist/base.py @@ -26,9 +26,9 @@ class UlmConfiguration: sidepanel_enabled: bool = DEFAULT_SIDEPANEL_ENABLED sidepanel_icon: str = DEFAULT_SIDEPANEL_ICON sidepanel_title: str = DEFAULT_SIDEPANEL_TITLE - advanced_enabled: bool = DEFAULT_SIDEPANEL_ENABLED - advanced_icon: str = DEFAULT_SIDEPANEL_ICON - advanced_title: str = DEFAULT_SIDEPANEL_TITLE + advanced_ui_enabled: bool = DEFAULT_SIDEPANEL_ENABLED + advanced_ui_icon: str = DEFAULT_SIDEPANEL_ICON + advanced_ui_title: str = DEFAULT_SIDEPANEL_TITLE theme_path: str = DEFAULT_THEME_PATH theme: str = DEFAULT_THEME plugin_path: str = "www/community/" diff --git a/custom_components/ui_lovelace_minimalist/configure.py b/custom_components/ui_lovelace_minimalist/configure.py index fca0b4d9c..e7f83ccaa 100644 --- a/custom_components/ui_lovelace_minimalist/configure.py +++ b/custom_components/ui_lovelace_minimalist/configure.py @@ -67,7 +67,7 @@ def configure_cards(hass: HomeAssistant, ulm: UlmBase): hass.config.path(f"{DOMAIN}/dashboard/ui-lovelace.yaml"), ) # Copy advanced dashboard if not exists and is selected as option - if ulm.configuration.advanced_enabled: + if ulm.configuration.advanced_ui_enabled: if not os.path.exists( hass.config.path(f"{DOMAIN}/dashboard/advanced-dash") ): diff --git a/custom_components/ui_lovelace_minimalist/const.py b/custom_components/ui_lovelace_minimalist/const.py index 2cf481c01..b08414763 100644 --- a/custom_components/ui_lovelace_minimalist/const.py +++ b/custom_components/ui_lovelace_minimalist/const.py @@ -31,9 +31,9 @@ CONF_SIDEPANEL_ENABLED = "sidepanel_enabled" CONF_SIDEPANEL_TITLE = "sidepanel_title" CONF_SIDEPANEL_ICON = "sidepanel_icon" -CONF_SIDEPANEL_ADV_ENABLED = "advanced_enabled" -CONF_SIDEPANEL_ADV_TITLE = "advanced_title" -CONF_SIDEPANEL_ADV_ICON = "advanced_icon" +CONF_SIDEPANEL_ADV_ENABLED = "advanced_ui_enabled" +CONF_SIDEPANEL_ADV_TITLE = "advanced_ui_title" +CONF_SIDEPANEL_ADV_ICON = "advanced_ui_icon" CONF_THEME = "theme" CONF_THEME_PATH = "theme_path" CONF_THEME_OPTIONS = [ diff --git a/custom_components/ui_lovelace_minimalist/load_dashboard.py b/custom_components/ui_lovelace_minimalist/load_dashboard.py index 421fa3f97..860bf60b1 100644 --- a/custom_components/ui_lovelace_minimalist/load_dashboard.py +++ b/custom_components/ui_lovelace_minimalist/load_dashboard.py @@ -30,9 +30,9 @@ def load_dashboard(hass: HomeAssistant, ulm: UlmBase): adv_dashboard_url = "advanced-dash" adv_dashboard_config = { "mode": "yaml", - "icon": ulm.configuration.advanced_icon, - "title": ulm.configuration.advanced_title, - "filename": "ui_lovelace_minimalist/dashboard/advanced-dash/test.yaml", + "icon": ulm.configuration.advanced_ui_icon, + "title": ulm.configuration.advanced_ui_title, + "filename": "ui_lovelace_minimalist/dashboard/advanced-dash/advanced-ui.yaml", "show_in_sidebar": True, "require_admin": False, } @@ -48,7 +48,7 @@ def load_dashboard(hass: HomeAssistant, ulm: UlmBase): if dashboard_url in hass.data["lovelace"]["dashboards"]: async_remove_panel(hass, "ui-lovelace-minimalist") - if ulm.configuration.advanced_enabled: + if ulm.configuration.advanced_ui_enabled: hass.data["lovelace"]["dashboards"][adv_dashboard_url] = LovelaceYAML( hass, adv_dashboard_url, adv_dashboard_config ) @@ -56,4 +56,4 @@ def load_dashboard(hass: HomeAssistant, ulm: UlmBase): _register_panel(hass, adv_dashboard_url, "yaml", adv_dashboard_config, True) else: if adv_dashboard_url in hass.data["lovelace"]["dashboards"]: - async_remove_panel(hass, "ui-lovelace-minimalist") + async_remove_panel(hass, "advanced-dash") diff --git a/custom_components/ui_lovelace_minimalist/lovelace/advanced-dash/test.yaml b/custom_components/ui_lovelace_minimalist/lovelace/advanced-dash/advanced-ui.yaml similarity index 100% rename from custom_components/ui_lovelace_minimalist/lovelace/advanced-dash/test.yaml rename to custom_components/ui_lovelace_minimalist/lovelace/advanced-dash/advanced-ui.yaml diff --git a/custom_components/ui_lovelace_minimalist/lovelace/advanced-dash/popup/popup.yaml b/custom_components/ui_lovelace_minimalist/lovelace/advanced-dash/popup/popup.yaml new file mode 100644 index 000000000..e69de29bb diff --git a/custom_components/ui_lovelace_minimalist/lovelace/advanced-dash/views/main.yaml b/custom_components/ui_lovelace_minimalist/lovelace/advanced-dash/views/main.yaml new file mode 100644 index 000000000..e69de29bb diff --git a/custom_components/ui_lovelace_minimalist/translations/cs.json b/custom_components/ui_lovelace_minimalist/translations/cs.json index a6a8b10fe..136ec8c1a 100644 --- a/custom_components/ui_lovelace_minimalist/translations/cs.json +++ b/custom_components/ui_lovelace_minimalist/translations/cs.json @@ -10,6 +10,9 @@ "sidepanel_enabled": "Zobrazit v postranním panelu", "sidepanel_icon": "Ikona v postranním panel", "sidepanel_title": "Název v postranním panelu", + "advanced_ui_enabled": "Enable advanced Dashboard with popup splitview", + "advanced_ui_title": "Advanced panel title", + "advanced_ui_icon": "Advanced panel icon", "theme": "Motiv", "include_other_cards": "Do zdrojů zahrnout vlastní karty, na kterých závisí tato integrace." } @@ -30,6 +33,9 @@ "sidepanel_enabled": "Zobrazit v postranním panelu", "sidepanel_icon": "Ikona v postranním panel", "sidepanel_title": "Název v postranním panelu", + "advanced_ui_enabled": "Enable advanced Dashboard with popup splitview", + "advanced_ui_title": "Advanced panel title", + "advanced_ui_icon": "Advanced panel icon", "theme": "Motiv", "include_other_cards": "Do zdrojů zahrnout vlastní karty, na kterých závisí tato integrace." } diff --git a/custom_components/ui_lovelace_minimalist/translations/de.json b/custom_components/ui_lovelace_minimalist/translations/de.json index 84bc3abfb..55c759f86 100644 --- a/custom_components/ui_lovelace_minimalist/translations/de.json +++ b/custom_components/ui_lovelace_minimalist/translations/de.json @@ -10,6 +10,9 @@ "sidepanel_enabled": "Erstellung eines Eintrages in der Seitenleiste aktivieren.", "sidepanel_icon": "Icon Seitenleiste", "sidepanel_title": "Titel Seitenleiste", + "advanced_ui_enabled": "Enable advanced Dashboard with popup splitview", + "advanced_ui_title": "Advanced panel title", + "advanced_ui_icon": "Advanced panel icon", "theme": "Thema", "include_other_cards": "Individuelle Karten, die für die Nutzung benötigt werden, ebenfalls laden." } @@ -30,6 +33,9 @@ "sidepanel_enabled": "Erstellung eines Eintrages in der Seitenleiste aktivieren.", "sidepanel_icon": "Icon Seitenleiste", "sidepanel_title": "Titel Seitenleiste", + "advanced_ui_enabled": "Enable advanced Dashboard with popup splitview", + "advanced_ui_title": "Advanced panel title", + "advanced_ui_icon": "Advanced panel icon", "theme": "Thema", "include_other_cards": "Individuelle Karten, die für die Nutzung benötigt werden, ebenfalls laden." } diff --git a/custom_components/ui_lovelace_minimalist/translations/en.json b/custom_components/ui_lovelace_minimalist/translations/en.json index e3870fd08..a9b22cee7 100644 --- a/custom_components/ui_lovelace_minimalist/translations/en.json +++ b/custom_components/ui_lovelace_minimalist/translations/en.json @@ -10,9 +10,9 @@ "sidepanel_enabled": "Enable creation of a Dashboard entry in the Side panel.", "sidepanel_icon": "Side panel icon", "sidepanel_title": "Side panel title", - "advanced_enabled": "Enable advanced Dashboard with popup splitview", - "advanced_title": "Advanced panel title", - "advanced_icon": "Advanced panel icon", + "advanced_ui_enabled": "Enable advanced Dashboard with popup splitview", + "advanced_ui_title": "Advanced panel title", + "advanced_ui_icon": "Advanced panel icon", "theme": "Theme", "include_other_cards": "Include custom card resources it's depending on." } @@ -33,9 +33,9 @@ "sidepanel_enabled": "Enable creation of a Dashboard entry in the Side panel.", "sidepanel_icon": "Side panel icon", "sidepanel_title": "Side panel title", - "advanced_enabled": "Enable advanced Dashboard with popup splitview", - "advanced_title": "Advanced panel title", - "advanced_icon": "Advanced panel icon", + "advanced_ui_enabled": "Enable advanced Dashboard with popup splitview", + "advanced_ui_title": "Advanced panel title", + "advanced_ui_icon": "Advanced panel icon", "theme": "Theme", "include_other_cards": "Include custom card resources it's depending on." } diff --git a/custom_components/ui_lovelace_minimalist/translations/it.json b/custom_components/ui_lovelace_minimalist/translations/it.json index 5b65f14b0..f90b2ab7c 100644 --- a/custom_components/ui_lovelace_minimalist/translations/it.json +++ b/custom_components/ui_lovelace_minimalist/translations/it.json @@ -10,6 +10,9 @@ "sidepanel_enabled": "Abilita la creazione di una nuova Dashboard nel Pannello Laterale.", "sidepanel_icon": "Icona Pannello Laterale", "sidepanel_title": "Titolo Pannello Laterale", + "advanced_ui_enabled": "Enable advanced Dashboard with popup splitview", + "advanced_ui_title": "Advanced panel title", + "advanced_ui_icon": "Advanced panel icon", "theme": "Tema", "include_other_cards": "Inlcudere le risorse da cui dipendono le card personalizzate." } @@ -30,6 +33,9 @@ "sidepanel_enabled": "Abilita la creazione di una nuova Dashboard nel Pannello Laterale.", "sidepanel_icon": "Icona Pannello Laterale", "sidepanel_title": "Titolo Pannello Laterale", + "advanced_ui_enabled": "Enable advanced Dashboard with popup splitview", + "advanced_ui_title": "Advanced panel title", + "advanced_ui_icon": "Advanced panel icon", "theme": "Tema", "include_other_cards": "Inlcudere le risorse da cui dipendono le card personalizzate." } diff --git a/custom_components/ui_lovelace_minimalist/translations/nl.json b/custom_components/ui_lovelace_minimalist/translations/nl.json new file mode 100644 index 000000000..ce9f852ea --- /dev/null +++ b/custom_components/ui_lovelace_minimalist/translations/nl.json @@ -0,0 +1,49 @@ +{ + "title": "UI Lovelace Minimalist", + "config": { + "step": { + "user": { + "title": "UI Lovelace Minimalist Instellingen", + "description": "", + "data": { + "language": "Taal", + "sidepanel_enabled": "Een Dashboard aan de zijbalk toevoegen", + "sidepanel_icon": "Dashboard icon", + "sidepanel_title": "Dashboard titel", + "advanced_ui_enabled": "Een advanced Dashboard aan de zijbalk toevoegen", + "advanced_ui_title": "Advanced dashboard titel", + "advanced_ui_icon": "Advanced dashboard icon", + "theme": "Thema", + "include_other_cards": "'Frontend' repositories toevoegen die nodig zijn" + } + } + }, + "abort": { + "single_instance_allowed": "Enkel een installatie van UI Lovelace Minimalist is toegestaan.", + "not_setup": "UI Lovelace Minimalist is niet juist ingesteld." + } + }, + "options": { + "step": { + "user": { + "title": "UI Lovelace Minimalist Instellingen", + "description": "", + "data": { + "language": "Taal", + "sidepanel_enabled": "Een Dashboard aan de zijbalk toevoegen", + "sidepanel_icon": "Dashboard icon", + "sidepanel_title": "Dashboard titel", + "advanced_ui_enabled": "Een advanced Dashboard aan de zijbalk toevoegen", + "advanced_ui_title": "Advanced dashboard titel", + "advanced_ui_icon": "Advanced dashboard icon", + "theme": "Thema", + "include_other_cards": "'Frontend' repositories toevoegen die nodig zijn" + } + } + }, + "abort": { + "single_instance_allowed": "Enkel een installatie van UI Lovelace Minimalist is toegestaan.", + "not_setup": "UI Lovelace Minimalist is niet juist ingesteld." + } + } +} diff --git a/custom_components/ui_lovelace_minimalist/translations/pl.json b/custom_components/ui_lovelace_minimalist/translations/pl.json index 90a85dab8..ce872c8b5 100644 --- a/custom_components/ui_lovelace_minimalist/translations/pl.json +++ b/custom_components/ui_lovelace_minimalist/translations/pl.json @@ -10,6 +10,9 @@ "sidepanel_enabled": "Utwórz nowy Dashboard w panelu bocznym.", "sidepanel_icon": "Ikona w panelu bocznym", "sidepanel_title": "Tytuł w panelu bocznym", + "advanced_ui_enabled": "Enable advanced Dashboard with popup splitview", + "advanced_ui_title": "Advanced panel title", + "advanced_ui_icon": "Advanced panel icon", "theme": "Motyw", "include_other_cards": "Dołącz zasoby wymagane przez niestandardowe karty." } @@ -30,6 +33,9 @@ "sidepanel_enabled": "Utwórz nowy Dashboard w panelu bocznym.", "sidepanel_icon": "Ikona w panelu bocznym", "sidepanel_title": "Tytuł w panelu bocznym", + "advanced_ui_enabled": "Enable advanced Dashboard with popup splitview", + "advanced_ui_title": "Advanced panel title", + "advanced_ui_icon": "Advanced panel icon", "theme": "Motyw", "include_other_cards": "Dołącz zasoby wymagane przez niestandardowe karty." } diff --git a/custom_components/ui_lovelace_minimalist/translations/ru.json b/custom_components/ui_lovelace_minimalist/translations/ru.json index c42f9999f..a3fd04042 100644 --- a/custom_components/ui_lovelace_minimalist/translations/ru.json +++ b/custom_components/ui_lovelace_minimalist/translations/ru.json @@ -10,6 +10,9 @@ "sidepanel_enabled": "Создайте новую Панель инструментов на боковой панели.", "sidepanel_icon": "Значок боковой панели", "sidepanel_title": "Название боковой панели", + "advanced_ui_enabled": "Enable advanced Dashboard with popup splitview", + "advanced_ui_title": "Advanced panel title", + "advanced_ui_icon": "Advanced panel icon", "theme": "Тема", "include_other_cards": "Включите ресурсы, необходимые для пользовательских карт." } @@ -30,6 +33,9 @@ "sidepanel_enabled": "Создайте новую Панель инструментов на боковой панели.", "sidepanel_icon": "Значок боковой панели", "sidepanel_title": "Название боковой панели", + "advanced_ui_enabled": "Enable advanced Dashboard with popup splitview", + "advanced_ui_title": "Advanced panel title", + "advanced_ui_icon": "Advanced panel icon", "theme": "Тема", "include_other_cards": "Включите ресурсы, необходимые для пользовательских карт." } diff --git a/custom_components/ui_lovelace_minimalist/translations/sk.json b/custom_components/ui_lovelace_minimalist/translations/sk.json index 95308e05d..77a9c9d48 100644 --- a/custom_components/ui_lovelace_minimalist/translations/sk.json +++ b/custom_components/ui_lovelace_minimalist/translations/sk.json @@ -10,6 +10,9 @@ "sidepanel_enabled": "Zobraziť v postrannom paneli", "sidepanel_icon": "Ikona v postrannom paneli", "sidepanel_title": "Názov v postrannom paneli", + "advanced_ui_enabled": "Enable advanced Dashboard with popup splitview", + "advanced_ui_title": "Advanced panel title", + "advanced_ui_icon": "Advanced panel icon", "theme": "Téma", "include_other_cards": "Do zdrojov zahrnúť vlastné karty potrebné pre túto integráciu." } @@ -30,6 +33,9 @@ "sidepanel_enabled": "Zobraziť v postrannom paneli", "sidepanel_icon": "Ikona v postrannom paneli", "sidepanel_title": "Názov v postrannom paneli", + "advanced_ui_enabled": "Enable advanced Dashboard with popup splitview", + "advanced_ui_title": "Advanced panel title", + "advanced_ui_icon": "Advanced panel icon", "theme": "Téma", "include_other_cards": "Do zdrojov zahrnúť vlastné karty potrebné pre túto integráciu." } From 081c2994865c610cd5ff19c8baf571c64271a0a9 Mon Sep 17 00:00:00 2001 From: basbruss <68892092+basbruss@users.noreply.github.com> Date: Mon, 30 May 2022 13:53:45 +0200 Subject: [PATCH 3/3] Build files for dashboard --- .../lovelace/advanced-dash/advanced-ui.yaml | 37 +++- .../lovelace/advanced-dash/popup/popup.yaml | 159 ++++++++++++++++++ .../advanced-dash/views/living_room.yaml | 34 ++++ .../lovelace/advanced-dash/views/main.yaml | 30 ++++ 4 files changed, 255 insertions(+), 5 deletions(-) create mode 100644 custom_components/ui_lovelace_minimalist/lovelace/advanced-dash/views/living_room.yaml diff --git a/custom_components/ui_lovelace_minimalist/lovelace/advanced-dash/advanced-ui.yaml b/custom_components/ui_lovelace_minimalist/lovelace/advanced-dash/advanced-ui.yaml index 011a7df0d..dac3c0a9a 100644 --- a/custom_components/ui_lovelace_minimalist/lovelace/advanced-dash/advanced-ui.yaml +++ b/custom_components/ui_lovelace_minimalist/lovelace/advanced-dash/advanced-ui.yaml @@ -1,13 +1,40 @@ --- -# this is a test file button_card_templates: !include_dir_merge_named "../../../custom_components/ui_lovelace_minimalist/__ui_minimalist__/ulm_templates/" title: "UI Lovelace Minimalist" theme: "minimalist-desktop" background: "var(--background-image)" -# views: !include_dir_merge_list "views/" views: - - title: "Example View" - path: 0 - icon: "mdi:flower" + - type: "custom:grid-layout" + title: "home" + icon: "mdi:home" + path: "0" + layout: + grid-template-columns: "1fr 1fr" + grid-template-rows: "min-content" + grid-template-areas: | + "main popup" + mediaquery: + "(max-width: 1100px), (orientation: portrait)": + grid-template-columns: "100%" + grid-template-areas: "main" cards: + - !include "views/main.yaml" + - !include "popup/popup-view.yaml" + + - type: "custom:grid-layout" + title: "Livingroom" + icon: "mdi:sofa" + path: "Livingroom" + layout: + grid-template-columns: "1fr 1fr" + grid-template-rows: "min-content" + grid-template-areas: | + "livingroom popup" + mediaquery: + "(max-width: 1100px), (orientation: portrait)": + grid-template-columns: "100%" + grid-template-areas: "livingroom" + cards: + - !include "views/livingroom.yaml" + - !include "popup/popup-view.yaml" diff --git a/custom_components/ui_lovelace_minimalist/lovelace/advanced-dash/popup/popup.yaml b/custom_components/ui_lovelace_minimalist/lovelace/advanced-dash/popup/popup.yaml index e69de29bb..69615d0f4 100644 --- a/custom_components/ui_lovelace_minimalist/lovelace/advanced-dash/popup/popup.yaml +++ b/custom_components/ui_lovelace_minimalist/lovelace/advanced-dash/popup/popup.yaml @@ -0,0 +1,159 @@ +--- +type: "custom:state-switch" +view_layout: + grid-area: "popup" + show: + mediaquery: "(min-width: 1100px)" +entity: +default: "default" +transition: "slide-down" +transition_time: 500 +states: + # Devices + ## Lights + light 1: + type: "custom:button-card" + template: "popup_light_brightness" + variables: + ulm_popup_light_entity: + light 2: + type: "custom:button-card" + template: "popup_light_brightness" + variables: + ulm_popup_light_entity: + light 3: + type: "custom:button-card" + template: "popup_light_brightness" + variables: + ulm_popup_light_entity: + light 4: + type: "custom:button-card" + template: "popup_light_brightness" + variables: + ulm_popup_light_entity: + light 5: + type: "custom:button-card" + template: "popup_light_brightness" + variables: + ulm_popup_light_entity: + light 6: + type: "custom:button-card" + template: "popup_light_brightness" + variables: + ulm_popup_light_entity: + light 7: + type: "custom:button-card" + template: "popup_light_brightness" + variables: + ulm_popup_light_entity: + light 8: + type: "custom:button-card" + template: "popup_light_brightness" + variables: + ulm_popup_light_entity: + light 9: + type: "custom:button-card" + template: "popup_light_brightness" + variables: + ulm_popup_light_entity: + light 10: + type: "custom:button-card" + template: "popup_light_brightness" + variables: + ulm_popup_light_entity: + + ## Mediaplayers + mediaplayer 1: + type: "custom:button-card" + template: "popup_media_player_infos" + variables: + ulm_popup_media_player_entity: + mediaplayer 2: + type: "custom:button-card" + template: "popup_media_player_infos" + variables: + ulm_popup_media_player_entity: + mediaplayer 3: + type: "custom:button-card" + template: "popup_media_player_infos" + variables: + ulm_popup_media_player_entity: + mediaplayer 4: + type: "custom:button-card" + template: "popup_media_player_infos" + variables: + ulm_popup_media_player_entity: + mediaplayer 5: + type: "custom:button-card" + template: "popup_media_player_infos" + variables: + ulm_popup_media_player_entity: + + ## Thermostats + climate 1: + type: "custom:button-card" + template: "popup_thermostat_temperature" + variables: + ulm_popup_thermostat_entity: + climate 2: + type: "custom:button-card" + template: "popup_thermostat_temperature" + variables: + ulm_popup_thermostat_entity: + climate 3: + type: "custom:button-card" + template: "popup_thermostat_temperature" + variables: + ulm_popup_thermostat_entity: + climate 4: + type: "custom:button-card" + template: "popup_thermostat_temperature" + variables: + ulm_popup_thermostat_entity: + climate 5: + type: "custom:button-card" + template: "popup_thermostat_temperature" + variables: + ulm_popup_thermostat_entity: + + ## Power + power 1: + type: "custom:button-card" + template: "popup_power_outlet_stats" + variables: + ulm_popup_power_outlet_entity: + ulm_popup_power_outlet_sensor1: + ulm_popup_power_outlet_sensor2: + ulm_popup_power_outlet_graph_sensor: + power 2: + type: "custom:button-card" + template: "popup_power_outlet_stats" + variables: + ulm_popup_power_outlet_entity: + ulm_popup_power_outlet_sensor1: + ulm_popup_power_outlet_sensor2: + ulm_popup_power_outlet_graph_sensor: + power 3: + type: "custom:button-card" + template: "popup_power_outlet_stats" + variables: + ulm_popup_power_outlet_entity: + ulm_popup_power_outlet_sensor1: + ulm_popup_power_outlet_sensor2: + ulm_popup_power_outlet_graph_sensor: + power 4: + type: "custom:button-card" + template: "popup_power_outlet_stats" + variables: + ulm_popup_power_outlet_entity: + ulm_popup_power_outlet_sensor1: + ulm_popup_power_outlet_sensor2: + ulm_popup_power_outlet_graph_sensor: + power 5: + type: "custom:button-card" + template: "popup_power_outlet_stats" + variables: + ulm_popup_power_outlet_entity: + ulm_popup_power_outlet_sensor1: + ulm_popup_power_outlet_sensor2: + ulm_popup_power_outlet_graph_sensor: diff --git a/custom_components/ui_lovelace_minimalist/lovelace/advanced-dash/views/living_room.yaml b/custom_components/ui_lovelace_minimalist/lovelace/advanced-dash/views/living_room.yaml new file mode 100644 index 000000000..b3ea58cc7 --- /dev/null +++ b/custom_components/ui_lovelace_minimalist/lovelace/advanced-dash/views/living_room.yaml @@ -0,0 +1,34 @@ +--- +type: "custom:layout-card" +layout_type: "custom:grid-layout" +layout: + grid-template-rows: "min-content" + grid-template-columns: "1fr 1fr 1fr" + grid-template-areas: > + "title title title" + "card1 card1 card1" + "card2 card3 card4" + "card5 card6 ." + "card7 card8 card9" + "card10 card11 card12" + "card13 card14 card15" + "card16 card17 card18" + mediaquery: + # Mobile + "(max-width: 800px)": + grid-template-columns: "1fr 1fr" + grid-template-areas: | + "title title" + "card1 card1" + "card2 card3" + "card4 card5" + "card6 card7" + "card8 card9" + "card10 card11" + "card12 card13" + "card14 card15" + "card16 card17" + "card18 card19" +view_layout: + grid-area: "livingroom" +cards: diff --git a/custom_components/ui_lovelace_minimalist/lovelace/advanced-dash/views/main.yaml b/custom_components/ui_lovelace_minimalist/lovelace/advanced-dash/views/main.yaml index e69de29bb..869839190 100644 --- a/custom_components/ui_lovelace_minimalist/lovelace/advanced-dash/views/main.yaml +++ b/custom_components/ui_lovelace_minimalist/lovelace/advanced-dash/views/main.yaml @@ -0,0 +1,30 @@ +--- +type: "custom:layout-card" +layout_type: "custom:grid-layout" +layout: + # Tablet portrait + grid-template-columns: "1fr 1fr 1fr 1fr 1fr 1fr" + grid-template-areas: | + "text text text weather weather weather" + "person person person weather weather weather" + "welcome welcome welcome welcome welcome welcome" + "title1 title1 title1 title1 title1 title1" + "card1 card1 card2 card2 card3 card3" + "title2 title2 title2 title2 title2 title2" + "card4 card4 card5 card5 card6 card6" + mediaquery: + # Mobile + "(max-width: 800px)": + grid-template-columns: "1fr 1fr" + grid-template-areas: | + "welcome welcome" + "person person" + "title1 title1" + "card1 card2" + "card3 card4" + "title2 title2" + "card5 card6" + "card7 card8" +view_layout: + grid-area: "main" +cards: