Skip to content

Commit 24ba791

Browse files
committed
[weather.openmeteo] 1.0.29
1 parent f2c4e8c commit 24ba791

File tree

1,767 files changed

+3097
-859
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,767 files changed

+3097
-859
lines changed

weather.openmeteo/CHANGELOG.txt

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,25 @@
1+
v1.0.29 (12/11/2025)
2+
--------------------
3+
* Personalized weather forecast should now work with any skin
4+
* Forecast support up to 12 days
5+
* Reworked addon settings
6+
7+
v1.0.26 (4/11/2025)
8+
--------------------
9+
* Personalized weather forecast
10+
* Alternative weather API for skin developers
11+
* Added timeofday window properties
12+
* Added snow window property
13+
* Added season window property
14+
* Added new default WMO weather icons
15+
* Added setting to disable map layers for any location
16+
Note: Only the first location is enabled by default
17+
* Do not rely on addon settings for geolocation
18+
* Fixed rare exception if weather data is not up to date
19+
* Fixed addon settings corruption on some android devices (hopefully)
20+
* Added translation: Italian (thanks @mapi68)
21+
* Added translation: Russian (thanks @feruk)
22+
123
v1.0.14 (22/07/2025)
224
--------------------
325
* Added pressure units: hPa, kPa, mmHg, inHg, psi

weather.openmeteo/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
- No account or API key required
77
- Geolocation (only on first run)
8-
- Current, hourly and daily weather
8+
- Current, hourly, daily and timeofday weather
99
- Maps: Radar, Infrared, Temperature, Wind Maps, ...
1010
12h history for map animations (Requires skin support)
1111
- Airquality: AQI, PM25, PM10, ... (Requires skin support)
@@ -14,6 +14,6 @@
1414
- Weather alert notifications
1515
- Weather alert properties for skins (Requires skin support)
1616
- Graphs (Requires skin support)
17-
Special window properties that can be used for graphs (e.g. Example)
17+
Special window properties that can be used for graphs
1818
- WMO weather codes support (Requires skin support)
1919
WMO icons are more precise than KODIs builtin codes

weather.openmeteo/addon.xml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
2-
<addon id="weather.openmeteo" name="Open-Meteo" version="1.0.14" provider-name="OpenHT">
2+
<addon id="weather.openmeteo" name="Open-Meteo" version="1.0.29" provider-name="OpenHT">
33
<requires>
44
<import addon="xbmc.python" version="3.0.0"/>
55
<import addon="script.module.requests" version="2.27.1+matrix.1"/>
@@ -20,6 +20,10 @@
2020
<description lang="hu_HU">Időjárás, térképek, levegőminőség és pollenelőrejelzés az open-meteo.com, a rainviewer.com, a weather.gc.ca és a met.no oldalakról</description>
2121
<summary lang="id_ID">Prakiraan cuaca oleh Open-Meteo</summary>
2222
<description lang="id_ID">Ramalan cuaca, peta, kualitas udara, dan serbuk sari dari open-meteo.com, rainviewer.com, weather.gc.ca dan met.no</description>
23+
<summary lang="it_IT">Previsioni meteo di Open-Meteo</summary>
24+
<description lang="it_IT">Meteo, mappe, qualità dell'aria e previsioni del polline da open-meteo.com, rainviewer.com, weather.gc.ca e met.no</description>
25+
<summary lang="ru_RU">Прогноз погоды от Open-Meteo</summary>
26+
<description lang="ru_RU">Прогноз погоды, карты, качество воздуха и пыльцы от open-meteo.com, rainviewer.com, weather.gc.ca и met.no</description>
2327
<summary lang="sk_SK">Predpoveď počasia z Open-Meteo</summary>
2428
<description lang="sk_SK">Počasie, mapy, kvalita vzduchu a peľové údaje z open-meteo.com, rainviewer.com, weather.gc.ca a met.no</description>
2529
<summary lang="ta_IN">திறந்த-மெட்டியோவிலிருந்து வானிலை முன்னறிவிப்பு</summary>

weather.openmeteo/lib/api.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ def getdata(type, loc, map=None):
8080

8181
# URL
8282
if type == 'weather':
83-
url = config.map_api.get(type).format(map[0], map[1])
83+
url = config.map_api.get(type).format(map[0], map[1], config.maxdays)
8484
elif type == 'airquality':
8585
url = config.map_api.get(type).format(map[0], map[1])
8686
elif type == 'sun':
@@ -159,7 +159,6 @@ def getrvindex(type):
159159
# Get location (GeoIP)
160160
def getloc(locid):
161161
utils.log(f'Geolocation ...')
162-
utils.setsetting('geoip', 'true')
163162

164163
# Get location
165164
try:

weather.openmeteo/lib/config.py

Lines changed: 413 additions & 278 deletions
Large diffs are not rendered by default.

weather.openmeteo/lib/conv.py

Lines changed: 93 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ def speedconv(value, unit):
126126
if unit == 'mph':
127127
v = value / 1.609344
128128
elif unit == 'm/min':
129-
v = value * 16,667
129+
v = value * 16.667
130130
elif unit == 'm/s':
131131
v = value / 3.6
132132
elif unit == 'ft/h':
@@ -291,6 +291,36 @@ def precipconv(value, unit):
291291
def precip(value=False):
292292
return precipconv(value, config.addon.precip)
293293

294+
# Snow
295+
def snowconv(value, unit):
296+
if value is not False:
297+
value = float(value)
298+
299+
if unit == 'in':
300+
v = value / 2.54
301+
else:
302+
v = value
303+
304+
if config.addon.snowdp == '0':
305+
return round(v)
306+
else:
307+
if config.addon.unitsep == ',':
308+
return str(round(v,int(config.addon.snowdp))).replace('.',',')
309+
else:
310+
return round(v,int(config.addon.snowdp))
311+
312+
else:
313+
314+
if unit == 'in':
315+
v = 'in'
316+
else:
317+
v = 'cm'
318+
319+
return v
320+
321+
def snow(value=False):
322+
return snowconv(value, config.addon.snow)
323+
294324
# Pressure
295325
def pressureconv(value, unit):
296326
if value is not False:
@@ -382,3 +412,65 @@ def moonphaseimage(deg):
382412
elif deg >= 273 and deg <= 357:
383413
return '7.png'
384414

415+
# Season
416+
def season(lat):
417+
d = utils.dt('dayofyear')
418+
419+
if lat >= 0:
420+
n = True
421+
else:
422+
n = False
423+
424+
if d >= 80 and d <= 172:
425+
return utils.locaddon(32471) if n else utils.locaddon(32473)
426+
elif d >= 172 and d <= 264:
427+
return utils.locaddon(32472) if n else utils.locaddon(32474)
428+
elif d >= 264 and d <= 355:
429+
return utils.locaddon(32473) if n else utils.locaddon(32471)
430+
else:
431+
return utils.locaddon(32474) if n else utils.locaddon(32472)
432+
433+
# Item
434+
def item(value, type, unit=True):
435+
436+
if type == 'temperature':
437+
v = temp(value)
438+
u = temp()
439+
elif type == 'precipitation':
440+
v = precip(value)
441+
u = precip()
442+
elif type == 'snow':
443+
v = snow(value)
444+
u = snow()
445+
elif type == 'speed':
446+
v = speed(value)
447+
u = speed()
448+
elif type == 'distance':
449+
v = distance(value)
450+
u = distance()
451+
elif type == 'pressure':
452+
v = pressure(value)
453+
u = pressure()
454+
elif type == 'uvindex':
455+
v = temp(value, config.addon.uvindexdp)
456+
u = ''
457+
elif type == 'solarradiation':
458+
v = dp(value, config.addon.radiationdp)
459+
u = 'W/m²'
460+
elif type == 'particles':
461+
v = dp(value, config.addon.particlesdp)
462+
u = 'μg/m³'
463+
elif type == 'pollen':
464+
v = dp(value, config.addon.pollendp)
465+
u = f'{utils.locaddon(32456)}/m³'
466+
else:
467+
v = round(value)
468+
u = ''
469+
470+
if value is False:
471+
return u
472+
else:
473+
if unit:
474+
return v, u
475+
else:
476+
return v

weather.openmeteo/lib/service.py

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,12 @@
88
def Main():
99
startup = True
1010
utils.log(f'Starting service ...')
11+
utils.setsetting('service', 'idle')
1112
utils.log(config.addon_info, 3)
1213

1314
# Geolocation
14-
if not utils.setting('geoip') and not utils.setting('loc1'):
15-
utils.setsetting('geoip', 'true')
15+
if not utils.geoip() and not utils.setting('loc1'):
16+
utils.geoip(True)
1617
utils.setsetting('service', 'running')
1718
weather.Main('1', mode='geoip')
1819
weather.Main('1', mode='download')
@@ -67,9 +68,3 @@ def Main():
6768
utils.log(f'Stopping service ...')
6869
api.s.close()
6970

70-
# Workaround KODI issue (v0.9.5)
71-
try:
72-
utils.setsetting('service', 'stopped')
73-
except:
74-
pass
75-

0 commit comments

Comments
 (0)