Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release #1395

Merged
merged 37 commits into from
Nov 2, 2023
Merged

Release #1395

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
54b292c
Create ca.json
M4rtik4 Jul 10, 2023
6634d14
Update ca.json
M4rtik4 Jul 10, 2023
e513be8
Update const.py
Borty97 Jul 11, 2023
c0efcc9
Update ca.json
M4rtik4 Jul 12, 2023
168f66b
Fix wrong variable referenced for service data for name hold action
tobias-groeger Jul 28, 2023
dace435
Add shadow to chips in dark mode
tobias-groeger Jul 29, 2023
9efd579
update localize
basbruss Jul 31, 2023
42a0f6f
Bugs chips
basbruss Jul 31, 2023
57275bb
Fix Bugs welcome scenes cards
basbruss Jul 31, 2023
e451a98
fix alignment chips
basbruss Jul 31, 2023
6d84602
Merge pull request #1331 from Borty97/patch-1
basbruss Jul 31, 2023
c36912a
Merge branch 'release' into patch-1
basbruss Jul 31, 2023
702c7e9
Merge pull request #1330 from M4rtik4/patch-1
basbruss Jul 31, 2023
7139671
Merge pull request #1344 from tobias-groeger/feature/chip-shadow-dark…
basbruss Jul 31, 2023
577ccbd
Merge pull request #1341 from tobias-groeger/fix/action-name-tap-serv…
basbruss Jul 31, 2023
331f2d5
performance increase triggers
basbruss Jul 31, 2023
798af8f
Merge branch 'release' into update
basbruss Aug 1, 2023
e488699
minor bugfixes
basbruss Aug 1, 2023
2292987
Update button-card.js
basbruss Aug 1, 2023
37c8ff6
Update vertical button card to support more toggle
valentinilk Aug 21, 2023
c32cd79
Added Hebrew Translation
kaaspad Sep 6, 2023
9b07e1d
Fixed ulm_card_media_player_enable_volume_adjust
r03l Sep 15, 2023
3f5a8ec
Update sk.json
misa1515 Sep 24, 2023
2644fa8
Fix 2023.11.0
basbruss Nov 2, 2023
4702212
Merge pull request #1361 from valentinilk/update_card_vertical_button
basbruss Nov 2, 2023
f569a02
Merge branch 'main' into main
basbruss Nov 2, 2023
45ad1e8
Merge branch 'release' into main
basbruss Nov 2, 2023
dd5b905
Merge pull request #1368 from kaaspad/main
basbruss Nov 2, 2023
4d9353e
Merge branch 'release' into release
basbruss Nov 2, 2023
fcab4c7
Merge pull request #1374 from r03l/release
basbruss Nov 2, 2023
a2482fd
Merge branch 'release' into patch-5
basbruss Nov 2, 2023
1a2f0b9
Merge pull request #1378 from misa1515/patch-5
basbruss Nov 2, 2023
19762f9
Merge branch 'release' into update
basbruss Nov 2, 2023
846e1ce
Merge remote-tracking branch 'upstream/main' into release
basbruss Nov 2, 2023
438d60b
Merge branch 'release' into update
basbruss Nov 2, 2023
daa2284
Merge pull request #1346 from basbruss/update
basbruss Nov 2, 2023
edc05b0
Update installation.md
basbruss Nov 2, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ card_media_player_chromecast:
- "icon_info"
- "blue_not_unavailable"
- "ulm_translation_engine"
label: "[[[ return variables.ulm_translation_state_unit ]]]"
label: "[[[ return variables.ulm_translation_state ]]]"
card_media_player_chromecast_with_controls:
variables:
ulm_card_media_player_with_controls_name: "No name set"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -712,7 +712,7 @@ custom_card_haven_washer_delayed_text:
show_icon: false
show_label: true
show_name: false
label: "[[[ return variables.ulm_translation_state_unit ]]]"
label: "[[[ return variables.ulm_translation_state ]]]"
styles:
state:
- color: "rgba(var(--color-theme),0.9)"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ widget_text:
show_icon: false
show_label: true
show_name: false
label: "[[[ return variables.ulm_translation_state_unit ]]]"
label: "[[[ return variables.ulm_translation_state ]]]"
styles:
grid:
- grid-template-areas: "'l'"
Expand Down
30 changes: 15 additions & 15 deletions custom_cards/custom_card_input_number/card_input_number.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,13 @@ card_input_number:
tap_action:
action: "call-service"
service: |
[[[
if( entity.entity_id.startsWith("input_number.") )
return "input_number.decrement";
if( entity.entity_id.startsWith("counter.") )
return "counter.decrement";
return "";
]]]
[[[
if( entity.entity_id.startsWith("input_number.") )
return "input_number.decrement";
if( entity.entity_id.startsWith("counter.") )
return "counter.decrement";
return "";
]]]
service_data:
entity_id: "[[[ return entity.entity_id ]]]"
icon: "mdi:arrow-down"
Expand All @@ -67,13 +67,13 @@ card_input_number:
tap_action:
action: "call-service"
service: |
[[[
if( entity.entity_id.startsWith("input_number.") )
return "input_number.increment";
if( entity.entity_id.startsWith("counter.") )
return "counter.increment";
return "";
]]]
[[[
if( entity.entity_id.startsWith("input_number.") )
return "input_number.increment";
if( entity.entity_id.startsWith("counter.") )
return "counter.increment";
return "";
]]]
service_data:
entity_id: "[[[ return entity.entity_id ]]]"
icon: "mdi:arrow-up"
Expand All @@ -91,7 +91,7 @@ widget_text:
show_icon: false
show_label: true
show_name: false
label: "[[[ return variables.ulm_translation_state_unit ]]]"
label: "[[[ return variables.ulm_translation_state ]]]"
styles:
grid:
- grid-template-areas: "'l'"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ custom_card_irmajavi_entities:
custom_widget_irmajavi:
show_label: true
show_icon: false
label: "[[[ return variables.ulm_translation_state_unit ]]]"
label: "[[[ return variables.ulm_translation_state ]]]"
styles:
name:
- justify-self: "center"
Expand Down

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions custom_components/ui_lovelace_minimalist/const.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,11 @@
"German": "de",
"English (GB)": "en",
"Spanish": "es",
"Català": "ca",
"French": "fr",
"Italian": "it",
"Dutch": "nl",
"Hebrew": "he",
"Norwegian": "no",
"Polish": "pl",
"Portuguese": "pt",
Expand All @@ -45,9 +47,11 @@
"German",
"English (GB)",
"Spanish",
"Català",
"French",
"Italian",
"Dutch",
"Hebrew",
"Norwegian",
"Polish",
"Portuguese",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,84 +22,27 @@ ulm_translation_engine:
return (!not_active.includes(entity.state) && !containsNumbers(entity.state))
}
]]]
ulm_translation_hour: >
[[[
var number = hass.resources[hass['language']]["ui.duration.hour"];
var matches = number.match(/[^{\}]+(?=})/g);
var hour = "Hour";
if (matches) {
var hour = matches[1];
}
return(hour);
]]]
ulm_translation_hours: >
[[[
var number = hass.resources[hass['language']]["ui.duration.hour"];
var matches = number.match(/[^{\}]+(?=})/g);
var hour = "Hours";
if (matches) {
var hour = matches[2];
}
return(hour);
]]]
ulm_translation_hvac: >
[[[
if (typeof(entity) !== 'undefined' && entity !== undefined){
let state = entity.state;
let d_class = entity.attributes.device_class;
let def = ["unknown", "unavailable"];
let lang = hass["language"];
let action = entity.attributes.hvac_action;
let domain = entity.entity_id.substr(0, entity.entity_id.indexOf("."));
var mode = hass.resources[lang]["state_attributes." + domain + ".hvac_action." + action];
if (def.includes(state)) {
var mode = hass.resources[lang]["state.default." + state ];
}
var label = hass.resources[lang]["component." + domain + ".state._." + state];
var translation = label ? label : state;
return (entity.attributes.current_temperature ) + '°' + ' • ' + translation + ((entity.state !='off' && mode !== undefined) ? ' (' + mode + ')' : '');
}
]]]
ulm_translation_off: "[[[ return hass.resources[hass['language']]['state.default.off']; ]]]"
ulm_translation_on: "[[[ return hass.resources[hass['language']]['state.default.on']; ]]]"
ulm_translation_state: >
[[[
if (typeof(entity) !== 'undefined' && entity !== undefined){
let state = entity.state;
let d_class = entity.attributes.device_class;
let def = ["unknown", "unavailable"];
let device_class = entity.attributes.device_class;
let lang = hass["language"];
let action = entity.attributes.hvac_action;
let domain = entity.entity_id.substr(0, entity.entity_id.indexOf("."));
var translation = hass.resources[lang]["component." + domain + ".entity_component._.state." + state]
let display_precision = hass.entities[entity.entity_id]?.display_precision
const now = new Date();
const timestamp = (new Date(state)).getTime();
const nowTimeStamp = now.getTime();
const microSecondsDiff = Math.round(timestamp - nowTimeStamp);
const daysDiff = Math.round(microSecondsDiff / (1000 * 60 * 60 * 24));
const hoursDiff = Math.round(microSecondsDiff / (1000 * 60 * 60));
const minutesDiff = Math.round(microSecondsDiff / (1000 * 60));
const secondsDiff = Math.round(microSecondsDiff / (1000));
const formatter = new Intl.RelativeTimeFormat(lang, { numeric: 'auto' });
var scale = 'day'
var diff = daysDiff
if (Math.abs(secondsDiff) < 60){ scale = 'second'; diff = secondsDiff }
else if (Math.abs(minutesDiff) < 60){ scale = 'minute'; diff = minutesDiff }
else if (Math.abs(hoursDiff) < 24){ scale = 'hour'; diff = hoursDiff }

if (def.includes(state)) {
var translation = hass.resources[lang]["state.default." + state ];
}
else if (domain == "binary_sensor" && d_class != ''){
var translation = hass.resources[lang]["component." + domain + ".entity_component." + d_class + ".state." + state]
let mode = hass.resources[lang]["state_attributes." + domain + ".hvac_action." + action];
if(variables.ulm_show_last_changed){
return helpers.relativeTime(entity.last_changed, true)
}
else if (d_class == 'timestamp'){
var translation = formatter.format(diff, scale)
if(device_class == 'timestamp'){
return helpers.relativeTime(entity.state, true)
}
else if (parseFloat(display_precision) >=0){
var translation = parseFloat(entity.state).toFixed(display_precision?.toString())
if(entity.entity_id.startsWith("climate.")){
return helpers.localize(entity, entity.attributes.current_temperature) + ' • ' +
helpers.localize(entity) + ((entity.state !='off' && mode !== undefined) ? ' (' + mode + ')' : '');
}
return translation ? translation.charAt(0).toUpperCase() + translation.slice(1) : state;
return helpers.localize(entity)
}
]]]
ulm_translation_state_reverse: >
Expand All @@ -119,59 +62,6 @@ ulm_translation_engine:
return translation ? translation : state;
}
]]]
ulm_translation_state_unit: >
[[[
if (typeof(entity) !== 'undefined' && entity !== undefined){
let state = entity.state;
let d_class = entity.attributes.device_class;
let def = ["unknown", "unavailable"];
let lang = hass["language"];
let domain = entity.entity_id.substr(0, entity.entity_id.indexOf("."));
let unit = entity.attributes.unit_of_measurement != null ? " " + entity.attributes.unit_of_measurement : "";
let display_precision = hass.entities[entity.entity_id]?.display_precision
const now = new Date();
const timestamp = (new Date(state)).getTime();
const nowTimeStamp = now.getTime();
const microSecondsDiff = Math.round(timestamp - nowTimeStamp);
const daysDiff = Math.round(microSecondsDiff / (1000 * 60 * 60 * 24));
const hoursDiff = Math.round(microSecondsDiff / (1000 * 60 * 60));
const minutesDiff = Math.round(microSecondsDiff / (1000 * 60));
const secondsDiff = Math.round(microSecondsDiff / (1000));
const formatter = new Intl.RelativeTimeFormat(lang, { numeric: 'auto' });

var scale = 'day'
var diff = daysDiff
if (Math.abs(secondsDiff) < 60){ scale = 'second'; diff = secondsDiff }
else if (Math.abs(minutesDiff) < 60){ scale = 'minute'; diff = minutesDiff }
else if (Math.abs(hoursDiff) < 24){ scale = 'hour'; diff = hoursDiff }

if(hass.resources[lang]["component." + domain + ".entity_component._.state." + state]){
var translation = hass.resources[lang]["component." + domain + ".entity_component._.state." + state] + unit
} else {
var translation = state + unit;
}
if (def.includes(state)) {
var translation = hass.resources[lang]["state.default." + state ];
}
else if (domain == "binary_sensor" && d_class != ''){
var translation = hass.resources[lang]["component." + domain + ".entity_component." + d_class + ".state." + state]
}
else if (domain == "media_player" && d_class != ''){
if (state == 'idle' || state == 'paused')
var translation = hass.resources[lang]["component." + domain + ".entity_component._.state." + state];
else {
var translation = (entity.attributes.source) + ' • ' + ( Math.round(entity.attributes.volume_level / 0.01)) + '%' ;
}
}
else if (d_class == 'timestamp'){
var translation = formatter.format(diff, scale);
}
else if (parseFloat(display_precision) >=0){
var translation = parseFloat(entity.state).toFixed(display_precision?.toString()) + unit
}
return translation ? translation.charAt(0).toUpperCase() + translation.slice(1) : state;
}
]]]
ulm_translation_statistics: "[[[ return hass.resources[hass['language']]['ui.components.statistic-picker.statistic']; ]]]"
ulm_translation_unavailable: "[[[ return hass.resources[hass['language']]['state.default.unavailable']; ]]]"
ulm_translation_currency: >
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
---
ulm_language_variables:
variables:
ulm_currency: "₪"
ulm_updates_available: "יש עדכונים"
ulm_no_updates_available: "אין עדכונים"
ulm_ophaling: "יש איסוף אשפה!"
ulm_geen_ophaling: "אין איסוף אשפה"
ulm_volgende_ophaling: "איסופי אשפה קרובים"
ulm_morning: "בוקר טוב"
ulm_afternoon: "צהריים טובים"
ulm_evening: "ערב טוב"
ulm_hello: "שלום"
ulm_volume: "ווליום"
ulm_popups_color: "צבע"
ulm_radar: "רדאר"
ulm_popup_total: "סך הכל"
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ ulm_actions_name:
'entity_id': entity.entity_id
};
}
return variables.ulm_card_name_service_data;
return variables.ulm_name_hold_service_data;
]]]
browser_mod:
service: "browser_mod.popup"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ card_graph:
ulm_card_graph_group_by: "interval"
ulm_card_graph_line_width: 5
ulm_card_graph_icon_color: ""
triggers_update: "all"
triggers_update:
- "[[[ return variables.ulm_card_graph_entity2 ]]]"
custom_fields:
item1:
card:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@ card_battery:
ulm_card_battery_color_battery_level_warning: "var(--google-yellow)"
ulm_card_battery_color_battery_level_ok: "var(--google-green)"
ulm_outlet_power_enable_popup: false
triggers_update: "all"
triggers_update:
- "[[[ return variables?.ulm_card_battery_battery_state_entity_id ]]]"
- "[[[ return variables?.ulm_card_battery_charger_type_entity_id ]]]"
custom_fields:
item1:
card:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ card_generic:
card:
type: "custom:button-card"
entity: "[[[ return entity.entity_id ]]]"
name: "[[[ return variables.ulm_translation_state_unit ]]]"
name: "[[[ return variables.ulm_translation_state ]]]"
label: "[[[ return variables.ulm_card_generic_name ]]]"
variables: >
[[[
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ card_generic_swap:
card:
type: "custom:button-card"
entity: "[[[ return entity.entity_id ]]]"
label: "[[[ return variables.ulm_translation_state_unit ]]]"
label: "[[[ return variables.ulm_translation_state ]]]"
name: "[[[ return variables.ulm_card_generic_swap_name ]]]"
variables: >
[[[
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,14 @@ card_media_player:
ulm_card_media_player_enable_controls: false
ulm_card_media_player_enable_volume_slider: false
ulm_card_media_player_enable_volume_buttons: false
ulm_card_media_player_enable_volume_adjust: false
ulm_card_media_player_enable_volume_adjust: 0
ulm_card_media_player_collapsible: false
ulm_card_media_player_player_controls_entity: "[[[ return entity.entity_id ]]]"
ulm_card_media_player_enable_popup: false
ulm_card_media_player_more_info: false
ulm_card_media_player_power_button: false
ulm_card_media_player_force_background_color: false
ulm_card_media_player_color: "blue"
triggers_update: "all"
show_icon: false
show_name: false
show_label: false
Expand Down Expand Up @@ -769,8 +768,8 @@ card_media_player:
volume_level: |
[[[
var volume = states[entity.entity_id].attributes.volume_level;
if (variables.ulm_card_media_player_enable_volume_adjust) {
volume = states[entity.entity_id].attributes.volume_level + ulm_card_media_player_enable_volume_adjust;
if (variables.ulm_card_media_player_enable_volume_adjust != 0) {
volume = states[entity.entity_id].attributes.volume_level - variables.ulm_card_media_player_enable_volume_adjust;
} else {
if (states[entity.entity_id].attributes.device_class === "tv") {
volume = states[entity.entity_id].attributes.volume_level - 0.01;
Expand Down Expand Up @@ -849,8 +848,8 @@ card_media_player:
volume_level: |
[[[
var volume = states[entity.entity_id].attributes.volume_level;
if (variables.ulm_card_media_player_enable_volume_adjust) {
volume = states[entity.entity_id].attributes.volume_level + ulm_card_media_player_enable_volume_adjust;
if (variables.ulm_card_media_player_enable_volume_adjust != 0) {
volume = states[entity.entity_id].attributes.volume_level + variables.ulm_card_media_player_enable_volume_adjust;
} else {
if (states[entity.entity_id].attributes.device_class === "tv") {
volume = states[entity.entity_id].attributes.volume_level + 0.01;
Expand Down
Loading
Loading