Fixed Milkforbid Time
This commit is contained in:
@@ -133,7 +133,7 @@ class CanListener (can.Listener):
|
||||
else:
|
||||
self.dataset [_address] = None
|
||||
self.log ("Tiernummer ist 0 ignoriere Melkdaten")
|
||||
|
||||
#---------------------------------------------------------------------------------------------------------------------------
|
||||
#State requeset
|
||||
elif infotype [_info_type] == 'state':
|
||||
_sendecho = 0 #No Echo on State telegram
|
||||
@@ -153,10 +153,10 @@ class CanListener (can.Listener):
|
||||
_aianimalnr, _aiearmark, _airfid, _aitsforbidstart, _aitsforbidend = animalinfo[0]
|
||||
_milkforbid = 0
|
||||
if _aitsforbidstart:
|
||||
dttsforbidstart = datetime.strptime (_aitsforbidstart, '%Y-%m-%d %H:%M:%S')
|
||||
dttsforbidstart = datetime.strptime (_aitsforbidstart +'00:00:00', '%Y-%m-%d %H:%M:%S')
|
||||
if datetime.now () > dttsforbidstart:
|
||||
if _aitsforbidend:
|
||||
dttsforbidend = datetime.strptime (_aitsforbidend, '%Y-%m-%d %H:%M:%S')
|
||||
dttsforbidend = datetime.strptime (_aitsforbidend + '23:59:59', '%Y-%m-%d %H:%M:%S')
|
||||
if datetime.now () <= dttsforbidend:
|
||||
_milkforbid = 1
|
||||
else:
|
||||
|
||||
Reference in New Issue
Block a user