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