Skip to content

Commit

Permalink
Merge pull request #1018 from UI-Lovelace-Minimalist/release
Browse files Browse the repository at this point in the history
Release v1.1.5
  • Loading branch information
basbruss authored Sep 28, 2022
2 parents 5dfe04f + e51fac0 commit 0fbd171
Show file tree
Hide file tree
Showing 10 changed files with 297 additions and 43 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ card_cover:
template:
- "icon_more_info_new"
- "ulm_translation_engine"
show_last_changed: false
variables:
ulm_card_cover_name: "[[[ return entity.attributes.friendly_name ]]]"
ulm_card_cover_display_left_right: false
Expand All @@ -14,6 +15,7 @@ card_cover:
ulm_card_cover_enable_slider: false
ulm_card_cover_enable_horizontal: false
ulm_card_cover_enable_popup: false
ulm_show_last_changed: false
show_icon: false
show_name: false
show_label: false
Expand Down Expand Up @@ -211,6 +213,7 @@ card_cover:
return variables.ulm_translation_state;
}
]]]
show_last_changed: "[[[ return variables.ulm_show_last_changed; ]]]"
item2:
card:
type: "custom:button-card"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,9 @@ card_vacuum:
ulm_card_vacuum_icon: "[[[ return entity.attributes.icon ]]]"
ulm_card_vacuum_room:
ulm_card_vacuum_room_icon: "[[[ return entity.attributes.icon ]]]"
ulm_card_vacuum_camera:
ulm_card_vacuum_camera_toggle:
ulm_card_vacuum_camera: ""
ulm_card_vacuum_enable_popup: false
ulm_card_vacuum_camera_toggle: false
ulm_card_vacuum_light_color: >
[[[
var state = entity.state.toLowerCase();
Expand All @@ -27,29 +28,37 @@ card_vacuum:
}
return (colors[state] || colors["default"]);
]]]
ulm_card_vacuum_camera_display: >
[[[
if (variables?.ulm_card_vacuum_camera){
if (variables?.ulm_card_vacuum_camera_toggle) {
if (entity.state.toLowerCase() === 'cleaning'){
return "true";
}
} else {
return "true";
}
}
]]]
triggers_update: "all"
styles:
grid:
- grid-template-areas: >
[[[
return variables.ulm_card_vacuum_camera_display ? "'item1' 'item3' 'item2'" : "'item1' 'item2'";
let map = "'item1' 'map' 'item2'"
if(variables.ulm_card_vacuum_camera != ""){
if(variables.ulm_card_vacuum_camera_toggle){
if(entity.state.toLowerCase() === 'cleaning' || entity.state.toLowerCase() === 'mopping'){
return map;
}
} else {
return map;
}
}
return "'item1' 'item2'"
]]]
- grid-template-columns: "1fr"
- grid-template-rows: >
[[[
return variables.ulm_card_vacuum_camera_display ? "repeat(3, min-content)" : "repeat(2, min-content)";
let map = "repeat(3, min-content)"
if(variables.ulm_card_vacuum_camera != ""){
if(variables.ulm_card_vacuum_camera_toggle){
if(entity.state.toLowerCase() === 'cleaning' || entity.state.toLowerCase() === 'mopping'){
return map;
}
} else {
return map;
}
}
return "repeat(2, min-content)"
]]]
- row-gap: "12px"
card:
Expand All @@ -63,10 +72,20 @@ card_vacuum:
}
]]]
custom_fields:
item3:
map:
- display: >
[[[
return variables.ulm_card_vacuum_camera_display ? "block" : "none";
let map = "block"
if(variables.ulm_card_vacuum_camera != ""){
if(variables.ulm_card_vacuum_camera_toggle){
if(entity.state.toLowerCase() === 'cleaning' || entity.state.toLowerCase() === 'mopping'){
return map;
}
} else {
return map;
}
}
return "none"
]]]
custom_fields:
item1:
Expand All @@ -78,6 +97,17 @@ card_vacuum:
type: "custom:button-card"
entity: "[[[ return entity.entity_id ]]]"
icon: "[[[ return variables.ulm_card_vacuum_icon ]]]"
variables: >
[[[
let vars = variables;
if(variables.ulm_card_vacuum_enable_popup) {
vars.ulm_custom_popup = {
'template': 'popup_vacuum_map',
'popup_variables': {'ulm_card_vacuum_camera': variables.ulm_card_vacuum_camera }
};
}
return vars;
]]]
styles:
icon:
- color: >
Expand All @@ -93,6 +123,17 @@ card_vacuum:
card:
type: "custom:button-card"
entity: "[[[ return entity.entity_id ]]]"
variables: >
[[[
let vars = variables;
if(variables.ulm_card_vacuum_enable_popup) {
vars.ulm_custom_popup = {
'template': 'popup_vacuum_map',
'popup_variables': {'ulm_card_vacuum_camera': variables.ulm_card_vacuum_camera }
};
}
return vars;
]]]
name: "[[[ return variables.ulm_card_vacuum_name ]]]"
label: >
[[[
Expand All @@ -104,6 +145,20 @@ card_vacuum:
}
return label;
]]]
map:
card:
type: "custom:button-card"
show_name: false
show_icon: false
show_label: false
entity: "[[[ return variables.ulm_card_vacuum_camera ]]]"
show_entity_picture: "true"
styles:
card:
- box-shadow: "none"
icon:
- border-radius: "20px"
- width: "100%"
item2:
card:
type: "custom:button-card"
Expand All @@ -126,7 +181,7 @@ card_vacuum:
icon: "mdi:play"
state:
- operator: "template"
value: "[[[ return entity.state.toLowerCase() === 'cleaning' ]]]"
value: "[[[ return ['cleaning','mopping'].includes(entity.state.toLowerCase()) ]]]"
icon: "mdi:stop"
tap_action:
action: "call-service"
Expand All @@ -137,7 +192,7 @@ card_vacuum:
action: "call-service"
service: >
[[[
return entity.state.toLowerCase() === 'cleaning' ? "vacuum.stop" : "vacuum.start";
return ['cleaning','mopping'].includes(entity.state.toLowerCase()) ? "vacuum.stop" : "vacuum.start";
]]]
service_data:
entity_id: "[[[ return entity.entity_id ]]]"
Expand Down Expand Up @@ -175,10 +230,3 @@ card_vacuum:
service: "script.turn_on"
service_data:
entity_id: "[[[ return variables.ulm_card_vacuum_room ]]]"
item3:
card:
type: "picture-entity"
camera_view: "live"
entity: "[[[ return variables.ulm_card_vacuum_camera ]]]"
show_name: false
show_state: false
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,15 @@ icon_more_info_new:
ulm_icon_double_tap_service: "[[[ return variables.ulm_icon_double_tap_service; ]]]"
ulm_icon_double_tap_service_data: "[[[ return variables.ulm_icon_double_tap_service_data]]]"
ulm_custom_popup: "[[[ return variables.ulm_custom_popup; ]]]"
styles:
card:
- overflow: >
[[[
if (entity.state == "unavailable"){
return "visible"
}
return "hidden"
]]]
item2:
card:
type: "custom:button-card"
Expand Down Expand Up @@ -92,10 +101,10 @@ icon_more_info_new:
- padding: "6px"
- margin-left: "-6px"
- background-color: "rgba(0,0,0,0)"
label:
- overflow: "visible"
name:
- overflow: "visible"
# label:
# - overflow: "visible"
# name:
# - overflow: "visible"
custom_fields:
notification:
- display: "none"
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
---
popup_header_cover:
template:
- "popup_button"
- "ulm_translation_engine"
label: >-
[[[
if (entity.state !="unavailable"){
if (typeof states[entity.entity_id].attributes.current_position === "undefined"){
if (states[entity.entity_id].state == "closed"){
return variables.ulm_translation_state;
} else
return variables.ulm_translation_state;
} else {
if (states[entity.entity_id].attributes.current_position == 0){
return variables.ulm_translation_state;
} else {
return variables.ulm_translation_state + " • " + (states[entity.entity_id].attributes.current_position) + "%" ;
}
}
} else {
return variables.ulm_translation_state;
}
]]]
show_name: true
show_label: true
styles:
grid:
- grid-template-areas: "'i' 'n' 'l'"
- grid-template-columns: "auto"
- grid-template-rows: "min-content min-content min-content"
label:
- justify-self: "center"
- font-weight: "bold"
- font-size: "12px"
- filter: "opacity(40%)"
icon:
- color: >
[[[
if (typeof states[entity.entity_id].attributes.current_position === "undefined"){
if (states[entity.entity_id].state == "closed"){
return 'rgba(var(--color-theme),0.2)';
} else
return 'rgba(var(--color-blue),1)'
} else {
if (states[entity.entity_id].attributes.current_position == 0){
return 'rgba(var(--color-theme),0.2)';
} else {
return 'rgba(var(--color-blue),1)'
}
}
]]]
img_cell:
- left: "2px"
- background-color: >
[[[
if (typeof states[entity.entity_id].attributes.current_position === "undefined"){
if (states[entity.entity_id].state == "closed"){
return 'rgba(var(--color-theme),0.05)';
} else
return 'rgba(var(--color-blue),0.2)';
} else {
if (states[entity.entity_id].attributes.current_position == 0){
return 'rgba(var(--color-theme),0.05)';
} else {
return 'rgba(var(--color-blue),0.2)';
}
}
]]]
Loading

0 comments on commit 0fbd171

Please sign in to comment.