Skip to content

Commit

Permalink
Set Forecast Lat & Lon for skins that display seasons using (arguably…
Browse files Browse the repository at this point in the history
… dubious) logic
  • Loading branch information
bossanova808 committed Jan 9, 2024
1 parent 8f31714 commit d1b6aba
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 3 deletions.
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
* text=auto eol=lf
# These files are blocked from the release.zip creation
.gitignore export-ignore
.gitattributes export-ignore
Expand Down
6 changes: 3 additions & 3 deletions addon.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<addon id="weather.ozweather" name="Oz Weather" version="2.1.0" provider-name="Bossanova808">
<addon id="weather.ozweather" name="Oz Weather" version="2.1.1" provider-name="Bossanova808">
<requires>
<import addon="xbmc.python" version="3.0.0"/>
<import addon="script.module.requests" version="2.22.0+matrix.1"/>
Expand All @@ -22,8 +22,8 @@
<icon>icon.png</icon>
<fanart>fanart.jpg</fanart>
</assets>
<news>2.1.0
- Fix light_rain icon &amp; update BOM radar list
<news>2.1.1
- Add Latitude and Longitude to Window data for skins that display 'season' using (arguably dubious) logic
</news>
</extension>
</addon>
3 changes: 3 additions & 0 deletions changelog.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
2.1.1
- Add Latitude and Longitude to Window data for skins that display 'season' using (arguably dubious) logic

2.1.0
- Fix light_rain icon & update BOM radar list

Expand Down
6 changes: 6 additions & 0 deletions resources/lib/forecast.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ def clear_properties():

set_property(WEATHER_WINDOW, 'Forecast.City')
set_property(WEATHER_WINDOW, 'Forecast.Country')
set_property(WEATHER_WINDOW, 'Forecast.Latitude')
set_property(WEATHER_WINDOW, 'Forecast.Longitude')
set_property(WEATHER_WINDOW, 'Forecast.Updated')

set_property(WEATHER_WINDOW, 'ForecastUpdated')
Expand Down Expand Up @@ -248,6 +250,8 @@ def get_weather():

# Set the location we updated
location_in_use = ADDON.getSetting(f'Location{sys.argv[1]}BOM')
latitude = ADDON.getSetting(f'Location{sys.argv[1]}Lat')
longitude = ADDON.getSetting(f'Location{sys.argv[1]}Lon')
try:
location_in_use = location_in_use[0:location_in_use.index(' (')]
except ValueError:
Expand All @@ -258,5 +262,7 @@ def get_weather():
set_property(WEATHER_WINDOW, 'Current.Location', location_in_use)
set_property(WEATHER_WINDOW, 'Forecast.City', location_in_use)
set_property(WEATHER_WINDOW, 'Forecast.Country', "Australia")
set_property(WEATHER_WINDOW, 'Forecast.Latitude', latitude)
set_property(WEATHER_WINDOW, 'Forecast.Longitude', longitude)
set_property(WEATHER_WINDOW, 'Forecast.Updated', time.strftime("%d/%m @ %H:%M").lower())

0 comments on commit d1b6aba

Please sign in to comment.