Add alarm signals for full and not available stations

Signed-off-by: Bezleputh <carton_ben@yahoo.fr>
This commit is contained in:
Bezleputh 2013-05-24 00:35:17 +02:00 committed by Florent
commit 1901ec652b

View file

@ -47,6 +47,8 @@ class InfoStationPage(BasePage):
levelattach.name = u'Attach'
levelattach.address = u'%s' % adresse
lastvalue = GaugeMeasure()
if lastvalue.level < 1:
lastvalue.alarm = u'Full station'
lastvalue.level = float(value)
lastvalue.date = last_update
levelattach.lastvalue = lastvalue
@ -64,6 +66,8 @@ class InfoStationPage(BasePage):
status = 1
else:
status = -1
if lastvalue.level < 1:
lastvalue.alarm = u'Not available station'
lastvalue.level = float(status)
lastvalue.date = last_update
levelstatus.lastvalue = lastvalue