Google Air Quality: support languageCode / localization based on hass.config.language
#1841
-
Integration nameGoogle Air Quality Link to integration documentation on our websitehttps://rc.home-assistant.io/integrations/google_air_quality Describe the enhancementThe Google Air Quality integration currently doesn’t expose any way to control the It would be great if the integration could pass a configurable This should be a purely additive change and backward-compatible: if Use cases
Anything else?The Google Air Quality API supports curl -X POST -d '{
"universalAqi": true,
"location": {
"latitude": 37.419734,
"longitude": -122.0827784
},
"extraComputations": [
"HEALTH_RECOMMENDATIONS",
"DOMINANT_POLLUTANT_CONCENTRATION",
"POLLUTANT_CONCENTRATION",
"LOCAL_AQI",
"POLLUTANT_ADDITIONAL_INFO"
],
"languageCode": "en"
}' \
-H 'Content-Type: application/json' \
'https://airquality.googleapis.com/v1/currentConditions:lookup?key=YOUR_API_KEY' |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
|
🏷️ I've automatically added the |
Beta Was this translation helpful? Give feedback.
-
|
Hi, This was a lot more work, than just use the language code, but I think this is the better solution. |
Beta Was this translation helpful? Give feedback.
Hi,
my approach was to make it all in English. This allows to make enum sensors, which shows all possible values. The states will get translated by the localize project, and if you change the language in the frontend the state will be shown in your language, as soon as the translation is available.
So even each member of a household could choose his favorite language.
This was a lot more work, than just use the language code, but I think this is the better solution.