Skip to content

Commit

Permalink
Merge pull request #979 from basbruss/browser_mod
Browse files Browse the repository at this point in the history
Update browser mod service
  • Loading branch information
basbruss authored Sep 9, 2022
2 parents db7917f + c4a8368 commit 513bd2e
Show file tree
Hide file tree
Showing 22 changed files with 580 additions and 244 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@ ulm_actions_card:
if (action == 'adaptive'){
action = 'call-service'
}
if (domain == "media_player" && action == 'toggle'){
action = 'call-service';
}
if (action == 'popup' && (variables.ulm_custom_popup != null )){
let popup_config = variables.ulm_custom_popup;
if ((typeof popup_config === 'object') && 'template' in popup_config) {
Expand All @@ -41,7 +43,9 @@ ulm_actions_card:
if (action == 'adaptive'){
return 'input_select.select_option';
}
if(entity.entity_id.startsWith("media_player.")){
return 'media_player.media_play_pause';
}
return variables.ulm_card_tap_service;
]]]
service_data: >
Expand All @@ -54,19 +58,35 @@ ulm_actions_card:
'entity_id': variables.ulm_input_select
};
}
if(entity.entity_id.startsWith("media_player.")){
return {
'entity_id': entity.entity_id
};
}
return variables.ulm_card_tap_service_data;
]]]
browser_mod:
service: "browser_mod.popup"
data:
large: true
hide_header: true
style: |
--popup-background-color: var(--primary-background-color);
--popup-border-radius: 0px;
--popup-border-radius: 20px;
--popup-padding-x: 24px;
--popup-padding-y: 20px;
--popup-max-width: auto
--popup-min-width: 800px;
card_mod:
style:
ha-dialog$: |
@media (max-width: 800px){
div.mdc-dialog__container {
--mdc-dialog-min-width: 100vw;
--mdc-dialog-max-width: 100vw;
--mdc-dialog-min-height: 100%;
--ha-dialog-border-radius: 0px;
}
}
content:
type: "custom:button-card"
template: >
Expand Down Expand Up @@ -116,7 +136,9 @@ ulm_actions_card:
if (action == 'adaptive'){
action = 'call-service'
}
if (domain == "media_player" && action == 'toggle'){
action = 'call-service';
}
if (action == 'popup' && (variables.ulm_custom_popup != null )){
let popup_config = variables.ulm_custom_popup;
if ((typeof popup_config === 'object') && 'template' in popup_config) {
Expand All @@ -139,7 +161,9 @@ ulm_actions_card:
if (action == 'adaptive'){
return 'input_select.select_option';
}
if(entity.entity_id.startsWith("media_player.")){
return 'media_player.media_play_pause';
}
return variables.ulm_card_hold_service;
]]]
service_data: >
Expand All @@ -152,19 +176,35 @@ ulm_actions_card:
'entity_id': variables.ulm_input_select
};
}
if(entity.entity_id.startsWith("media_player.")){
return {
'entity_id': entity.entity_id
};
}
return variables.ulm_card_hold_service_data;
]]]
browser_mod:
service: "browser_mod.popup"
data:
large: true
hide_header: true
style: |
--popup-background-color: var(--primary-background-color);
--popup-border-radius: 0px;
--popup-border-radius: 20px;
--popup-padding-x: 24px;
--popup-padding-y: 20px;
--popup-max-width: auto
--popup-min-width: 800px;
card_mod:
style:
ha-dialog$: |
@media (max-width: 800px){
div.mdc-dialog__container {
--mdc-dialog-min-width: 100vw;
--mdc-dialog-max-width: 100vw;
--mdc-dialog-min-height: 100%;
--ha-dialog-border-radius: 0px;
}
}
content:
type: "custom:button-card"
template: >
Expand Down Expand Up @@ -214,7 +254,9 @@ ulm_actions_card:
if (action == 'adaptive'){
action = 'call-service'
}
if (domain == "media_player" && action == 'toggle'){
action = 'call-service';
}
if (action == 'popup' && (variables.ulm_custom_popup != null )){
let popup_config = variables.ulm_custom_popup;
if ((typeof popup_config === 'object') && 'template' in popup_config) {
Expand All @@ -237,7 +279,9 @@ ulm_actions_card:
if (action == 'adaptive'){
return 'input_select.select_option';
}
if(entity.entity_id.startsWith("media_player.")){
return 'media_player.media_play_pause';
}
return variables.ulm_card_double_tap_service;
]]]
service_data: >
Expand All @@ -250,19 +294,35 @@ ulm_actions_card:
'entity_id': variables.ulm_input_select
};
}
if(entity.entity_id.startsWith("media_player.")){
return {
'entity_id': entity.entity_id
};
}
return variables.ulm_card_double_tap_service_data;
]]]
browser_mod:
service: "browser_mod.popup"
data:
large: true
hide_header: true
style: |
--popup-background-color: var(--primary-background-color);
--popup-border-radius: 0px;
--popup-border-radius: 20px;
--popup-padding-x: 24px;
--popup-padding-y: 20px;
--popup-max-width: auto
--popup-min-width: 800px;
card_mod:
style:
ha-dialog$: |
@media (max-width: 800px){
div.mdc-dialog__container {
--mdc-dialog-min-width: 100vw;
--mdc-dialog-max-width: 100vw;
--mdc-dialog-min-height: 100%;
--ha-dialog-border-radius: 0px;
}
}
content:
type: "custom:button-card"
template: >
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@ ulm_actions_icon:
if (action == 'adaptive'){
action = 'call-service'
}
if (domain == "media_player" && action == 'toggle'){
action = 'call-service';
}
if (action == 'popup' && (variables.ulm_custom_popup != null )){
let popup_config = variables.ulm_custom_popup;
if ((typeof popup_config === 'object') && 'template' in popup_config) {
Expand All @@ -41,7 +43,9 @@ ulm_actions_icon:
if (action == 'adaptive'){
return 'input_select.select_option';
}
if(entity.entity_id.startsWith("media_player.")){
return 'media_player.media_play_pause';
}
return variables.ulm_icon_tap_service;
]]]
service_data: >
Expand All @@ -54,19 +58,35 @@ ulm_actions_icon:
'entity_id': variables.ulm_input_select
};
}
if(entity.entity_id.startsWith("media_player.")){
return {
'entity_id': entity.entity_id
};
}
return variables.ulm_icon_tap_service_data;
]]]
browser_mod:
service: "browser_mod.popup"
data:
large: true
hide_header: true
style: |
--popup-background-color: var(--primary-background-color);
--popup-border-radius: 0px;
--popup-border-radius: 20px;
--popup-padding-x: 24px;
--popup-padding-y: 20px;
--popup-max-width: auto
--popup-min-width: 800px;
card_mod:
style:
ha-dialog$: |
@media (max-width: 800px){
div.mdc-dialog__container {
--mdc-dialog-min-width: 100vw;
--mdc-dialog-max-width: 100vw;
--mdc-dialog-min-height: 100%;
--ha-dialog-border-radius: 0px;
}
}
content:
type: "custom:button-card"
template: >
Expand Down Expand Up @@ -115,7 +135,9 @@ ulm_actions_icon:
if (action == 'adaptive'){
action = 'call-service'
}
if (domain == "media_player" && action == 'toggle'){
action = 'call-service';
}
if (action == 'popup' && (variables.ulm_custom_popup != null )){
let popup_config = variables.ulm_custom_popup;
if ((typeof popup_config === 'object') && 'template' in popup_config) {
Expand All @@ -138,7 +160,9 @@ ulm_actions_icon:
if (action == 'adaptive'){
return 'input_select.select_option';
}
if(entity.entity_id.startsWith("media_player.")){
return 'media_player.media_play_pause';
}
return variables.ulm_icon_hold_service;
]]]
service_data: >
Expand All @@ -151,19 +175,35 @@ ulm_actions_icon:
'entity_id': variables.ulm_input_select
};
}
if(entity.entity_id.startsWith("media_player.")){
return {
'entity_id': entity.entity_id
};
}
return variables.ulm_icon_hold_service_data;
]]]
browser_mod:
service: "browser_mod.popup"
data:
large: true
hide_header: true
style: |
--popup-background-color: var(--primary-background-color);
--popup-border-radius: 0px;
--popup-border-radius: 20px;
--popup-padding-x: 24px;
--popup-padding-y: 20px;
--popup-max-width: auto
--popup-min-width: 800px;
card_mod:
style:
ha-dialog$: |
@media (max-width: 800px){
div.mdc-dialog__container {
--mdc-dialog-min-width: 100vw;
--mdc-dialog-max-width: 100vw;
--mdc-dialog-min-height: 100%;
--ha-dialog-border-radius: 0px;
}
}
content:
type: "custom:button-card"
template: >
Expand Down Expand Up @@ -213,7 +253,9 @@ ulm_actions_icon:
if (action == 'adaptive'){
action = 'call-service'
}
if (domain == "media_player" && action == 'toggle'){
action = 'call-service';
}
if (action == 'popup' && (variables.ulm_card_light_enable_popup || variables.ulm_card_media_player_enable_popup || variables.ulm_card_thermostat_enable_popup) ){
action = 'fire-dom-event'
}
Expand All @@ -240,7 +282,9 @@ ulm_actions_icon:
if (action == 'adaptive'){
return 'input_select.select_option';
}
if(entity.entity_id.startsWith("media_player.")){
return 'media_player.media_play_pause';
}
return variables.ulm_icon_double_tap_service;
]]]
service_data: >
Expand All @@ -253,19 +297,35 @@ ulm_actions_icon:
'entity_id': variables.ulm_input_select
};
}
if(entity.entity_id.startsWith("media_player.")){
return {
'entity_id': entity.entity_id
};
}
return variables.ulm_icon_double_tap_service_data;
]]]
browser_mod:
service: "browser_mod.popup"
data:
large: true
hide_header: true
style: |
--popup-background-color: var(--primary-background-color);
--popup-border-radius: 0px;
--popup-border-radius: 20px;
--popup-padding-x: 24px;
--popup-padding-y: 20px;
--popup-max-width: auto
--popup-min-width: 800px;
card_mod:
style:
ha-dialog$: |
@media (max-width: 800px){
div.mdc-dialog__container {
--mdc-dialog-min-width: 100vw;
--mdc-dialog-max-width: 100vw;
--mdc-dialog-min-height: 100%;
--ha-dialog-border-radius: 0px;
}
}
content:
type: "custom:button-card"
template: >
Expand Down
Loading

0 comments on commit 513bd2e

Please sign in to comment.