From b8ef99d07bdf9ff2500cc2148490585138b68b7b Mon Sep 17 00:00:00 2001 From: Ace Date: Sun, 29 Nov 2020 23:47:14 +0100 Subject: [PATCH] Use language from config instead of system language This fixes an issue where the weekday would be named according to the system language, but not the specified language in that module's settings. --- inkycal/modules/inkycal_weather.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/inkycal/modules/inkycal_weather.py b/inkycal/modules/inkycal_weather.py index 6f4a178..1464dc5 100644 --- a/inkycal/modules/inkycal_weather.py +++ b/inkycal/modules/inkycal_weather.py @@ -107,7 +107,7 @@ class Weather(inkycal_module): # additional configuration self.owm = OWM(self.api_key).weather_manager() self.timezone = get_system_tz() - self.locale = sys_locale()[0] + self.locale = config['language'] self.weatherfont = ImageFont.truetype( fonts['weathericons-regular-webfont'], size = self.fontsize) @@ -417,7 +417,9 @@ class Weather(inkycal_module): logger.debug((key,val)) # Get some current weather details - temperature = '{}°'.format(weather.temperature(unit=temp_unit)['temp']) + temperature = '{}°'.format(round( + weather.temperature(unit=temp_unit)['temp'], ndigits=dec_temp)) + weather_icon = weather.weather_icon_name humidity = str(weather.humidity) sunrise_raw = arrow.get(weather.sunrise_time()).to(self.timezone)