Hi all!
DarkSky API allows to receive hourly, daily and weekly forecasts in language other than english.
Now I’m using this dirty hack:
In file <config_dir>/deps/forecastio/api.py
lines 26 and 30
url = 'https://api.darksky.net/forecast/%s/%s,%s' \
'?units=%s' % (key, lat, lng, units,)
url = 'https://api.darksky.net/forecast/%s/%s,%s,%s' \
'?units=%s' % (key, lat, lng, url_time,
units,)
Adding lang=<preferred_lang>&
in API request URL (after question mark) gives us a forecasts in preferred language.
For example, I’m using russian:
url = 'https://api.darksky.net/forecast/%s/%s,%s' \
'?lang=it&units=%s' % (key, lat, lng, units,)
url = 'https://api.darksky.net/forecast/%s/%s,%s,%s' \
'?lang=it&units=%s' % (key, lat, lng, url_time,
units,)
List of available languages is in DarkSky API Docs.
Maybe it’s not very difficult to add this feature in HomeAssistant component as native, so we just set the language in config of darksky sensor, like units.