Skip to content

Commit

Permalink
Added lang setting for call to Dark Sky's API
Browse files Browse the repository at this point in the history
  • Loading branch information
genebean committed Feb 24, 2020
1 parent 91a934f commit 0a577de
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
6 changes: 6 additions & 0 deletions config.py.sample
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,12 @@ LON = -84.3880
# Valid values are: 'ca', 'si', uk2', and 'us'
UNITS = 'us'

# Set the language the information from Dark Sky's API
# is returned in. Units are not changed by this; they rely
# on the setting above named UNITS. See the `lang` section of
# https://darksky.net/dev/docs
LANG = 'en'

# Full screen is for when this is running on a TV or
# similar device with a much higher resolution.
FULLSCREEN = True
Expand Down
3 changes: 2 additions & 1 deletion weather.py
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,8 @@ def get_forecast(self):
config.LAT,
config.LON,
exclude='minutely',
units=config.UNITS)
units=config.UNITS,
lang=config.LANG)

sunset_today = datetime.datetime.fromtimestamp(
self.weather.daily[0].sunsetTime)
Expand Down

0 comments on commit 0a577de

Please sign in to comment.