diff --git a/README.md b/README.md index 04d9611..2c49c14 100644 --- a/README.md +++ b/README.md @@ -319,6 +319,7 @@ views: | included_devices | list (string) | **Optional** | List of devices that will display animated background. If this option is set any devices not included in this list will be excluded. Ex: iphone, ipad, windows, macintosh, android | excluded_users | list (string) | **Optional** | Users to be excluded | excluded_devices | list (string) | **Optional** | Devices to be excluded Ex: iphone, ipad, windows, macintosh, android +| background | string | **Optional** | CSS option for the background overlay. Default is 'transparent' ## Example if you want a different background for night and day when a switch changes (or any combination of entities) A few people have asked about tying this to multiple entities. The good news is this is already possible with the use of a template sensor. Here is an example of a template sensor that would allow a different background for night/day when a bedroom switch changes. diff --git a/dist/animated-background.js b/dist/animated-background.js index f2dbcb7..2899820 100644 --- a/dist/animated-background.js +++ b/dist/animated-background.js @@ -526,9 +526,13 @@ function urlIsVideo(url){ } //removes lovelace theme background -function removeDefaultBackground(node) { - if (node.style.background != 'transparent' || View_Layout.style.background != 'transparent') { - node.style.background = 'transparent'; +function removeDefaultBackground(node, current_config) { + var background = 'transparent'; + if(current_config.background){ + background = current_config.background; + } + if (node.style.background != background || View_Layout.style.background != 'transparent') { + node.style.background = background; View_Layout.style.background = 'transparent'; } } @@ -565,7 +569,7 @@ function processDefaultBackground(temp_enabled) { iphone_bullshit_fixer = view_node_panel; } if (temp_enabled) { - removeDefaultBackground(iphone_bullshit_fixer); + removeDefaultBackground(iphone_bullshit_fixer, current_config); DEBUG_MESSAGE("Removing view background for configuration:", currentConfig(), true); } else {