Stop UpdateIndex if there is an error
This commit is contained in:
parent
4897387ab0
commit
0771aacf20
|
@ -142,10 +142,11 @@ class NodeRedGridMeter:
|
|||
logging.debug("---");
|
||||
|
||||
# increment UpdateIndex - to show that new data is available
|
||||
index = self._dbusservice['/UpdateIndex'] + 1 # increment index
|
||||
if index > 255: # maximum value of the index
|
||||
index = 0 # overflow from 255 to 0
|
||||
self._dbusservice['/UpdateIndex'] = index
|
||||
if self._dbusservice['/Connected'] == 1 :
|
||||
index = self._dbusservice['/UpdateIndex'] + 1 # increment index
|
||||
if index > 255: # maximum value of the index
|
||||
index = 0 # overflow from 255 to 0
|
||||
self._dbusservice['/UpdateIndex'] = index
|
||||
|
||||
#update lastupdate vars
|
||||
self._lastUpdate = time.time()
|
||||
|
|
Loading…
Reference in New Issue