Skip to content

Commit

Permalink
Bugfix
Browse files Browse the repository at this point in the history
  • Loading branch information
basbruss committed May 27, 2022
1 parent d23c5de commit a6d7ca0
Showing 1 changed file with 13 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,12 @@ popup_button_app:
- color: >
[[[
var color = "var(--color-theme)";
if(entity.attributes.app_name){
var app = entity.attributes.app_name.toLowerCase();
if(entity?.attributes?.app_name){
var app = entity.attributes?.app_name.toLowerCase();
if(app = "spotify"){
color = "#1DB954";
var color = "#1DB954";
}
} else if(entity.attributes.media_content_id.toLowerCase().includes("spotify")){
} else if(entity?.attributes?.media_content_id?.toLowerCase().includes("spotify")){
var color = "#1DB954";
}
return color;
Expand All @@ -43,20 +43,20 @@ popup_button_app:
- background-color: >
[[[
var color = "var(--color-theme)";
if(entity.attributes.app_name){
var app = entity.attributes.app_name.toLowerCase();
if(entity?.attributes?.app_name){
var app = entity?.attributes?.app_name?.toLowerCase();
if(app = "spotify"){
color = "#434343";
var color = "#434343";
}
} else if(entity.attributes.media_content_id.toLowerCase().includes("spotify")){
} else if(entity?.attributes?.media_content_id?.toLowerCase().includes("spotify")){
var color = "#434343";
}
return color;
]]]
icon: >
[[[
var icon = entity.attributes.icon || "mdi:speaker";
if(entity.attributes.app_name){
if(entity?.attributes?.app_name){
var app = entity.attributes.app_name.toLowerCase();
if(app == "spotify"){
var icon = "mdi:spotify";
Expand All @@ -77,7 +77,7 @@ popup_button_app:
} else if(app == "bluetooth audio"){
var icon = "mdi:bluetooth";
}
} else if(entity.attributes.media_content_id.toLowerCase().includes("spotify")){
} else if(entity?.attributes?.media_content_id?.toLowerCase().includes("spotify")){
var icon = "mdi:spotify";
}
return icon;
Expand All @@ -90,8 +90,8 @@ popup_button_app:
name: >
[[[
var name = entity.attributes.friendly_name;
if(entity.attributes.app_name){
var app = entity.attributes.app_name.toLowerCase();
if(entity?.attributes?.app_name){
var app = entity?.attributes?.app_name?.toLowerCase();
if(app == "spotify"){
var name = "Spotify";
} else if(app == "google podcasts"){
Expand All @@ -111,7 +111,7 @@ popup_button_app:
} else if(app == "bluetooth audio"){
var name = "Bluetooth";
}
} else if(entity.attributes.media_content_id.toLowerCase().includes("spotify")){
} else if(entity?.attributes?.media_content_id?.toLowerCase().includes("spotify")){
var name = "Spotify";
}
return name;
Expand Down

0 comments on commit a6d7ca0

Please sign in to comment.