kopia lustrzana https://github.com/sq9atk/sr0wx
Obsłużenie wyjątku braku danych z czujnika promieniowania
rodzic
62eacdf8ca
commit
392676d6d7
|
@ -77,8 +77,12 @@ class RadioactiveSq9atk(SR0WXModule):
|
|||
self.__logger.info("::: Przetwarzam dane...\n")
|
||||
data = self.getSensorData(html)
|
||||
|
||||
msvCurrent = int(float(data['current'])*1000)
|
||||
msvAverage = int(float(data['average'])*1000)
|
||||
try:
|
||||
msvCurrent = int(float(data['current'])*1000)
|
||||
msvAverage = int(float(data['average'])*1000)
|
||||
except:
|
||||
self.__logger.info("::: Brak danych z czujnika: " + str(self.__sensor_id) + "...\n")
|
||||
return {}
|
||||
|
||||
averageValue = " ".join(["wartos_c__aktualna",self.__language.read_decimal( msvCurrent )+" ","mikrosjiwerta","na_godzine_"])
|
||||
currentValue = " ".join(["s_rednia_wartos_c__dobowa",self.__language.read_decimal( msvAverage )+" ","mikrosjiwerta","na_godzine_"])
|
||||
|
|
Ładowanie…
Reference in New Issue