Skip to content

Commit

Permalink
Merge branch 'release' into popup_weather_forecast_fix
Browse files Browse the repository at this point in the history
  • Loading branch information
basbruss authored Aug 31, 2022
2 parents 15a5ae9 + 83cea93 commit 95cff61
Show file tree
Hide file tree
Showing 3 changed files with 59 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
---
### Overlay to enable custom actions card over other cards ###
ulm_actions_card_overlay:
template:
- "ulm_custom_actions"
- "ulm_actions_card"
styles:
grid:
- position: "relative"
- z-index: 0
custom_fields:
actions_card_overlay:
- position: "absolute"
- left: "0px"
- top: "0px"
- height: "100%"
- width: "100%"
- display: "grid"
- z-index: 10
custom_fields:
actions_card_overlay:
card:
type: "custom:button-card"
template:
- "ulm_actions_card"
entity: "[[[ return (entity != null) ? entity.entity_id : null; ]]]"
show_icon: false
show_name: false
show_label: false
styles:
card:
- height: "100%"
- background: "none"
variables:
ulm_input_select_option: "[[[ return variables.ulm_input_select_option; ]]]"
ulm_input_select: "[[[ return variables.ulm_input_select; ]]]"
ulm_card_tap_action: "[[[ return variables.ulm_card_tap_action; ]]]"
ulm_card_tap_haptic: "[[[ return variables.ulm_card_tap_haptic; ]]]"
ulm_card_tap_navigate_path: "[[[ return variables.ulm_card_tap_navigate_path; ]]]"
ulm_card_hold_action: "[[[ return variables.ulm_card_hold_action; ]]]"
ulm_card_hold_haptic: "[[[ return variables.ulm_card_hold_haptic; ]]]"
ulm_card_hold_navigate_path: "[[[ return variables.ulm_card_hold_navigate_path; ]]]"
ulm_card_double_tap_action: "[[[ return variables.ulm_card_double_tap_action; ]]]"
ulm_card_double_tap_haptic: "[[[ return variables.ulm_card_double_tap_haptic; ]]]"
ulm_card_double_tap_navigate_path: "[[[ return variables.ulm_card_double_tap_navigate_path; ]]]"
ulm_custom_popup: "[[[ return variables.ulm_custom_popup; ]]]"
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
---
### Card Weather ###
card_weather:
template:
- "ulm_actions_card_overlay"
variables:
ulm_card_weather_backdrop: false
ulm_card_weather_primary_info: "extrema"
Expand Down
11 changes: 11 additions & 0 deletions docs/setup/custom_actions.md
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,17 @@ Most of the internal card templates uses this option. Take a look into the code.
--8<-- "custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/card_templates/cards/card_generic.yaml"
```

### Use template `ulm_actions_card_overlay`

If you implement a custom card that is based on another Lovelace card like the
[weather card](https://ui-lovelace-minimalist.github.io/UI/usage/cards/card_weather/) you can simply enable custom
card actions by using the template `ulm_actions_card_overlay` on the card. This template adds an overlay over the whole card and
reaction on the tap, hold, double tap actions. It also enables the integration of custom popups for the card.
Actions of the underlying card will be disabled by this method.

The [weather card](https://ui-lovelace-minimalist.github.io/UI/usage/cards/card_weather/) gives you an example and
will show the usage of this method.

### Individual implementation

The following script shows the usage off all necessary variables and template that will be used by the custom actions.
Expand Down

0 comments on commit 95cff61

Please sign in to comment.