Pass language to the Airly API (#85655)

* Pass language to the API

* Pass only pl or en

* Add comment
pull/85756/head
Maciej Bieniek 2023-01-12 16:15:00 +01:00 committed by GitHub
parent 4895f2e7c2
commit cc016c9bba
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 1 deletions

View File

@ -150,7 +150,9 @@ class AirlyDataUpdateCoordinator(DataUpdateCoordinator):
"""Initialize.""" """Initialize."""
self.latitude = latitude self.latitude = latitude
self.longitude = longitude self.longitude = longitude
self.airly = Airly(api_key, session) # Currently, Airly only supports Polish and English
language = "pl" if hass.config.language == "pl" else "en"
self.airly = Airly(api_key, session, language=language)
self.use_nearest = use_nearest self.use_nearest = use_nearest
super().__init__(hass, _LOGGER, name=DOMAIN, update_interval=update_interval) super().__init__(hass, _LOGGER, name=DOMAIN, update_interval=update_interval)