Last active
June 9, 2020 08:07
-
-
Save nediam/6d7a8cb4f1253c247a9697191f6f3e41 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| {% set days_translation = ["Poniedziałek","Wtorek","Środa","Czwartek","Piątek", "Sobota","Niedziela"] %} | |
| {% set trash_translation = {"rest": "Zmieszane","glass": "Szkło","paper": "Papier","plastic": "Plastik","bio": "Bio","green": "Zielone","bulk": "Gabaryty"} %} | |
| {% set trash = states('sensor.trash')|from_json %} | |
| {% for item in trash %} | |
| {%- set date = trash[item] -%} | |
| {%- set days_to = (((as_timestamp(strptime(date, '%Y-%m-%d'))-as_timestamp(now()))/86400))|round(0,'ceil')-%} **{{ trash_translation[item] }}:** {{ days_to }} dni *({{ days_translation[strptime(date, '%Y-%m-%d').weekday()] }})* | |
| {% endfor %} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment