kopia lustrzana https://github.com/sq9atk/sr0wx
poprawka w module Meteoalarm - czytany był tylko pierwszy warning z kilku dla danego regionu
rodzic
3fb6336e94
commit
277f4eb4cd
|
@ -115,7 +115,8 @@ openweathersq9atk = OpenWeatherSq9atk(
|
|||
# meteoalarm_sq9atk
|
||||
# -----------------
|
||||
from meteoalarm_sq9atk import MeteoalarmSq9atk
|
||||
meteoalarmsq9atk = MeteoalarmSq9atk(region="PL008")
|
||||
#meteoalarmsq9atk = MeteoalarmSq9atk(region="PL008")
|
||||
meteoalarmsq9atk = MeteoalarmSq9atk(region="IT003") # testowo Lombardia
|
||||
# PL001-Mazowieckie
|
||||
# PL002-Lubuskie
|
||||
# PL003-Zachodniopomorskie
|
||||
|
@ -134,6 +135,7 @@ meteoalarmsq9atk = MeteoalarmSq9atk(region="PL008")
|
|||
# PL016-Podlaskie
|
||||
# PL801-Pomorze Wschodnie
|
||||
# PL802-Pomorze Zachodnie
|
||||
# IT003-Lombardia
|
||||
|
||||
|
||||
# -------------
|
||||
|
@ -334,7 +336,7 @@ from radioactive_sq9atk import RadioactiveSq9atk
|
|||
radioactivesq9atk = RadioactiveSq9atk(
|
||||
language=pl_google,
|
||||
service_url="http://radioactiveathome.org/map/",
|
||||
sensor_id=6314
|
||||
sensor_id=635 #czujnik w centrum Krakowa
|
||||
## więcej czujników na stronie http://radioactiveathome.org/map/
|
||||
)
|
||||
|
||||
|
|
|
@ -47,7 +47,7 @@ class MeteoalarmSq9atk(SR0WXModule):
|
|||
'PL011':"łódzkiego", 'PL012':"wielkopolskiego",
|
||||
'PL013':"kujawsko_pomorskiego", 'PL014':"warminsko_mazurskiego",
|
||||
'PL015':"lubelskiego", 'PL016':"podlaskiego",
|
||||
'IE003':"dolnoslaskiego",
|
||||
'IT003':"Lombardia",
|
||||
}
|
||||
|
||||
def getDataFromUrl(self, url):
|
||||
|
@ -67,11 +67,13 @@ class MeteoalarmSq9atk(SR0WXModule):
|
|||
for line in self.downloadFile(url).split('\n'):
|
||||
matches = r.findall(line)
|
||||
if len(matches) is not 0 and int(matches[0][0])!=0:
|
||||
result = [
|
||||
warn = " ".join([
|
||||
self.warnings[ int(matches[0][0]) ],
|
||||
self.warningsLevel,
|
||||
self.warningsLevels[ int(matches[0][1]) ],
|
||||
]
|
||||
])
|
||||
result.append(warn)
|
||||
result.append("_")
|
||||
return " ".join(result)
|
||||
|
||||
|
||||
|
|
Plik binarny nie jest wyświetlany.
Ładowanie…
Reference in New Issue