Skip to content

Commit

Permalink
Merge branch 'release' into styling
Browse files Browse the repository at this point in the history
  • Loading branch information
basbruss authored Oct 27, 2022
2 parents b2cf4d3 + d456a6a commit 771a1e5
Show file tree
Hide file tree
Showing 5 changed files with 261 additions and 20 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,205 @@
---
### Card Weather ULM ###
card_weather_ulm:
template:
- "icon_more_info_new"
- "ulm_translation_engine"
variables:
ulm_card_weather_ulm_enable_popup: false
ulm_weather_popup_surpress_first_forecast: false
show_icon: false
show_name: false
show_label: false
styles:
grid:
- grid-template-areas: "'item1' 'item2'"
- grid-template-columns: "1fr"
- grid-template-rows: "1fr 1fr"
- row-gap: "12px"
card:
- border-radius: "var(--border-radius)"
- box-shadow: "var(--box-shadow)"
- padding: "12px"
custom_fields:
item1:
card:
type: "custom:button-card"
custom_fields:
item1:
card:
type: "custom:button-card"
entity: "[[[ return entity.entity_id ]]]"
icon: |
[[[
var state = entity.state;
var icon = {
"clear-night": "mdi:weather-night",
"cloudy": "mdi:weather-cloudy",
"exceptional": "mdi:weather-sunny-alert",
"fog": "mdi:weather-fog",
"hail": "mdi:weather-hail",
"lightning": "mdi:weather-lightning",
"lightning-rainy": "mdi:weather-lightning-rainy",
"partlycloudy": "mdi:weather-partly-cloudy",
"pouring": "mdi:weather-pouring",
"rainy": "mdi:weather-rainy",
"snowy": "mdi:weather-snowy",
"snowy-rainy": "mdi:weather-snowy-rainy",
"sunny": "mdi:weather-sunny",
"windy": "mdi:weather-windy",
"default": "mdi:crosshairs-question"
}
return (icon[state] || icon["default"]);
]]]
variables: >
[[[
let vars = variables;
if(variables.ulm_card_weather_ulm_enable_popup) {
vars.ulm_custom_popup = {
'template': 'popup_weather_forecast',
'popup_variables': {'ulm_weather_popup_surpress_first_forecast': variables.ulm_weather_popup_surpress_first_forecast}
};
}
return vars;
]]]
styles:
icon:
- color: >
[[[
var state = entity.state;
var icon = {
"clear-night": "rgba(var(--color-yellow),1)",
"cloudy": "rgba(var(--color-blue),1)",
"exceptional": "rgba(var(--color-red),1)",
"fog": "rgba(var(--color-grey),1)",
"hail": "rgba(var(--color-blue),1)",
"lightning": "rgba(var(--color-blue),1)",
"lightning-rainy": "rgba(var(--color-blue),1)",
"partlycloudy": "rgba(var(--color-yellow),1)",
"pouring": "rgba(var(--color-grey),1)",
"rainy": "rgba(var(--color-blue),1)",
"snowy": "rgba(var(--color-blue),1)",
"snowy-rainy": "rgba(var(--color-blue),1)",
"sunny": "rgba(var(--color-yellow),1)",
"windy": "rgba(var(--color-grey),1)",
"default": "rgba(var(--color-grey),1)",
}
return (icon[state] || icon["default"]);
]]]
img_cell:
- background-color: >
[[[
var state = entity.state;
var icon = {
"clear-night": "rgba(var(--color-yellow),0.2)",
"cloudy": "rgba(var(--color-blue),0.2)",
"exceptional": "rgba(var(--color-red),0.2)",
"fog": "rgba(var(--color-grey),0.2)",
"hail": "rgba(var(--color-blue),0.2)",
"lightning": "rgba(var(--color-blue),0.2)",
"lightning-rainy": "rgba(var(--color-blue),0.2)",
"partlycloudy": "rgba(var(--color-yellow),0.2)",
"pouring": "rgba(var(--color-grey),0.2)",
"rainy": "rgba(var(--color-blue),0.2)",
"snowy": "rgba(var(--color-blue),0.2)",
"snowy-rainy": "rgba(var(--color-blue),0.2)",
"sunny": "rgba(var(--color-yellow),0.2)",
"windy": "rgba(var(--color-grey),0.2)",
"default": "rgba(var(--color-grey),0.2)",
}
return (icon[state] || icon["default"]);
]]]
item2:
card:
type: "custom:button-card"
entity: "[[[ return entity.entity_id ]]]"
show_state: true
styles:
grid:
- grid-template-areas: "'i n' 'i s'"
variables: >
[[[
let vars = variables;
if(variables.ulm_card_weather_ulm_enable_popup) {
vars.ulm_custom_popup = {
'template': 'popup_weather_forecast',
'popup_variables': {'ulm_weather_popup_surpress_first_forecast': variables.ulm_weather_popup_surpress_first_forecast}
};
}
return vars;
]]]
item2:
card:
type: "custom:button-card"
template: "list_2_items"
custom_fields:
item1:
card:
type: "custom:button-card"
entity: "[[[ return entity.entity_id ]]]"
icon: "mdi:water"
tap_action:
action: "none"
layout: "icon_state"
show_state: false
show_units: false
show_name: false
custom_fields:
item: "[[[ return entity.attributes.humidity + '%' ]]]"
styles:
grid:
- grid-template-areas: "'i item'"
- grid-template-columns: "40% 60%"
card:
- box-shadow: "none"
- padding: "0px"
- background-color: "rgba(var(--color-theme),0.05)"
- border-radius: "14px"
- place-self: "center"
- height: "42px"
icon:
- color: "rgba(var(--color-theme),0.9)"
img_cell:
- justify-content: "right"
custom_fields:
item:
- text-align: "left"
- font-size: "1rem"
size: "20px"
color: "var(--google-grey)"
item2:
card:
type: "custom:button-card"
entity: "[[[ return entity.entity_id ]]]"
icon: "mdi:thermometer"
tap_action:
action: "none"
layout: "icon_state"
show_state: false
show_units: false
show_name: false
custom_fields:
item: "[[[ return entity.attributes.temperature + entity.attributes.temperature_unit ]]]"
styles:
grid:
- grid-template-areas: "'i item'"
- grid-template-columns: "45% 55%"
card:
- box-shadow: "none"
- padding: "0px"
- background-color: "rgba(var(--color-theme),0.05)"
- border-radius: "14px"
- place-self: "center"
- height: "42px"
icon:
- color: "rgba(var(--color-theme),0.9)"
img_cell:
- justify-content: "right"
custom_fields:
item:
- text-align: "left"
- font-size: "1rem"
size: "20px"
color: "var(--google-grey)"
38 changes: 19 additions & 19 deletions custom_components/ui_lovelace_minimalist/translations/es.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,25 +6,25 @@
"title": "Configuración de UI Lovelace Minimalist",
"description": "",
"data": {
"community_cards_enabled": "Enable the ability to configure community cards with this integrations, Does require github authentication!"
"community_cards_enabled": "Activar la posibilidad de configurar las tarjetas de la comunidad con esta integración. ¡Requiere autenticación en GitHub!"
}
},
"device": {
"title": "Waiting for device activation"
"title": "Esperando la activación del dispositivo"
},
"reauth_confirm": {
"title": "Reauthentication needed",
"description": "You need to reauthenticate with GitHub."
"title": "Se necesita reautenticación",
"description": "Tienes que volver a autentificarte en GitHub."
}
},
"abort": {
"single_instance_allowed": "Sólo se permite una única configuración de UI Lovelace Minimalist.",
"single_instance_allowed": "Solo se permite una única configuración de UI Lovelace Minimalist.",
"not_setup": "UI Lovelace Minimalist no está configurado.",
"github": "Could not authenticate with GitHub, try again later.",
"reauth_successful": "Reauthentication was successful."
"github": "No se ha podido autentificar con GitHub, inténtalo más tarde.",
"reauth_successful": "La reautenticación se ha realizado con éxito."
},
"progress": {
"wait_for_device": "1. Open {url} \n2.Paste the following key to authorize ULM: \n```\n{code}\n```\n"
"wait_for_device": "1. Abre {url} \n2.Pega la siguiente clave para autorizar a ULM: \n```\n{code}\n```\n"
}
},
"options": {
Expand All @@ -34,27 +34,27 @@
"description": "",
"data": {
"language": "Idioma",
"sidepanel_enabled": "Habilitar la creación de una entrada en el panel lateral.",
"sidepanel_enabled": "Crear un nuevo panel en el panel lateral.",
"sidepanel_icon": "Icono del panel lateral",
"sidepanel_title": "Título del panel lateral",
"adaptive_ui_enabled": "Enable adaptive Dashboard with popup splitview",
"adaptive_ui_title": "adaptive panel title",
"adaptive_ui_icon": "adaptive panel icon",
"adaptive_ui_enabled": "Activar panel adaptable con vista dividida emergente",
"adaptive_ui_title": "título del panel adaptable",
"adaptive_ui_icon": "icono del panel adaptable",
"theme": "Tema",
"include_other_cards": "Incluir los recursos de la tarjeta personalizada de la que depende.",
"community_cards_enabled": "Enable the ability to configure community cards with this integrations, Does require github authentication!",
"community_cards": "Select Community Cards you want to enable."
"include_other_cards": "Incluir recursos de tarjetas personalizadas necesarias.",
"community_cards_enabled": "Activar la posibilidad de configurar las tarjetas de la comunidad con esta integración. ¡Requiere autenticación en GitHub!",
"community_cards": "Selecciona las tarjetas de la comunidad que quieres activar."
}
}
},
"abort": {
"single_instance_allowed": "Sólo se permite una única configuración de UI Lovelace Minimalist.",
"single_instance_allowed": "Solo se permite una única configuración de UI Lovelace Minimalist.",
"not_setup": "UI Lovelace Minimalist no está configurado."
},
"error": {
"github_cards": "Something went wrong when fetching cards from Github.",
"ack": "You need to acknowledge all statements.",
"gh_token": "Github Token not set. Please re-install this integration to go throught the setup procedure. (No custom configuration will be lost)"
"github_cards": "Algo ha ido mal al obtener las tarjetas de Github.",
"ack": "Debes aceptar todas las declaraciones.",
"gh_token": "El token de Github no está configurado. Por favor, vuelve a instalar esta integración para pasar por el procedimiento de configuración. (No se perderá ninguna configuración personalizada)"
}
}
}
Binary file added docs/assets/img/ulm_cards/card_weather_ulm.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion docs/setup/custom_cards.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ You don't need to do any extra inclusion in your dashboard yaml via `!include`,
!!! tip "Reloading"

Once you have added new custom_cards, you can always reload that folder via Home Assistant and add the new cards to the config.
Just go to `"Configuration" --> "Settings"` in Home Assistant and press the `"UI_LOVELACE_MINIMALIST"` button within the "YAML configuration reloading" section.
Just go to `"Developer Tools"` in Home Assistant and press the `"UI_LOVELACE_MINIMALIST"` button within the "YAML configuration reloading" section.

### Develop your own Custom-cards

Expand Down
36 changes: 36 additions & 0 deletions docs/usage/cards/card_weather_ulm.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
---
title: Weather Card ULM
hide:
- toc
---

<!-- markdownlint-disable MD046 -->

## Description

![example-image](../../assets/img/ulm_cards/card_weather_ulm.png){ width="500" }

This is a card to show your weather without usage of custom resources.

## Variables

| Variable | Default | Required | Notes |
| ----------------------------------- | -------- | ---------------- | ------------------------------------- |
| entity | | :material-check: | your weather entity |
| ulm_card_weather_ulm_enable_popup | `false` | :material-close: | |

## Usage

```yaml
- type: "custom:button-card"
template: "card_weather_ulm"
entity: "weather.lieusaint"
variables:
ulm_card_weather_ulm_enable_popup: true
```
??? note "Template Code"
```yaml title="card_weather.yaml"
--8<-- "custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/card_templates/cards/card_weather_ulm.yaml"
```

0 comments on commit 771a1e5

Please sign in to comment.