My dashboard markdown card config is,
{% set nr = states.sensor.formula_one_sensor_races.attributes.next_race %}
To display the flag, I use,
src="https://www.countries-ofthe-world.com/flags-normal/flag-of-{{nr.Circuit.Location.country | replace(" ","-")}}.png"
This has worked OK for all the races until now (except one other that I don't remember)
But for Abu Dhabi GP, the url is different. So I have to use,
src="https://www.countries-ofthe-world.com/flags-normal/flag-of-United-Arab-Emirates.png"
For the track layout for Abu Dhabi, country name in the sensor is UAE but the link needs AbuDhabi. So, I need to use,
`src="https://www.formula1.com/content/dam/fom-website/2018-redesign assets/Circuit%20maps%2016x9/{{nr.Circuit.Location.locality | replace(" ","")}}_Circuit.png.transform/7col/image.png"`
For other races,
src="https://www.formula1.com/content/dam/fom-website/2018-redesign-assets/Circuit%20maps%2016x9/{{nr.Circuit.Location.country | replace(" ","_")}}_Circuit.png.transform/7col/image.png"
Hi all,
My dashboard markdown card config is,
{% set nr = states.sensor.formula_one_sensor_races.attributes.next_race %}
To display the flag, I use,
src="https://www.countries-ofthe-world.com/flags-normal/flag-of-{{nr.Circuit.Location.country | replace(" ","-")}}.png"
This has worked OK for all the races until now (except one other that I don't remember)
But for Abu Dhabi GP, the url is different. So I have to use,
src="https://www.countries-ofthe-world.com/flags-normal/flag-of-United-Arab-Emirates.png"
Because country for Abu Dhabi in the sensor is UAE but the flag url needs United Arab Emirates. https://www.countries-ofthe-world.com/flags-normal/flag-of-United-Arab-Emirates.png
For the track layout for Abu Dhabi, country name in the sensor is UAE but the link needs AbuDhabi. So, I need to use, `src="https://www.formula1.com/content/dam/fom-website/2018-redesign assets/Circuit%20maps%2016x9/{{nr.Circuit.Location.locality | replace(" ","")}}_Circuit.png.transform/7col/image.png"`
https://www.formula1.com/content/dam/fom-website/2018-redesign-assets/Circuit%20maps%2016x9/Abu_Dhabi_Circuit.png.transform/7col/image.png
For other races,
src="https://www.formula1.com/content/dam/fom-website/2018-redesign-assets/Circuit%20maps%2016x9/{{nr.Circuit.Location.country | replace(" ","_")}}_Circuit.png.transform/7col/image.png"
Regards, Vaibhav