Hello everyone,
I was successfully able to change the background image based on the screen resolution. However, I can’t then change the image based on the time of day.
I report what I wrote in which in the first segment with min_width: 0 I try to change the path of the image based on a parameter (tested successfully I will replace xtesting with a sensor that I have already prepared and tested that calculate the time of the day (evening, day, night, ec.)). I can’t see the image in the browser in this way. While in the second segment, min_width: 2570, I get the desired result.
config:
defaults:
hover_action: hover-info
image:
sizes:
- min_width: 0
location: |
>
xtesting = 2;
if (xtesting == 3) { ytesting = "/local/floorplan-casa/SVG/Night1080/floorplan_optimised_night_1080.svg";}
else { ytesting = "/local/floorplan-casa/SVG/Day1080/floorplan_optimised_day_1080.svg";}
return (ytesting);
cache: false
- min_width: 2570
location: /local/floorplan-casa/SVG/Day1440/floorplan_optimised_day_1440.svg
cache: false
Thank You very much in advance
Regards