Fixed old Milkforbid
This commit is contained in:
20
ADIS_LKV.py
20
ADIS_LKV.py
@@ -188,15 +188,17 @@ class ADIS:
|
||||
animalnr, earmark, rfid, forbidmilk, tsforbidstart, tsforbidend = animalinfo
|
||||
#Check milking forbidden
|
||||
milkforbid = 0
|
||||
if forbidmilk and tsforbidstart:
|
||||
dttsforbidstart = datetime.strptime (tsforbidstart + ' 00:00:00', '%Y-%m-%d %H:%M:%S')
|
||||
if datetime.now () > dttsforbidstart:
|
||||
if tsforbidend:
|
||||
dttsforbidend = datetime.strptime (tsforbidend + ' 23:59:59', '%Y-%m-%d %H:%M:%S')
|
||||
if datetime.now () <= dttsforbidend:
|
||||
milkforbid = 1
|
||||
else:
|
||||
milkforbid = 1
|
||||
if forbidmilk:
|
||||
milkforbid = 1
|
||||
#if forbidmilk and tsforbidstart:
|
||||
# dttsforbidstart = datetime.strptime (tsforbidstart + ' 00:00:00', '%Y-%m-%d %H:%M:%S')
|
||||
# if datetime.now () > dttsforbidstart:
|
||||
# if tsforbidend:
|
||||
# dttsforbidend = datetime.strptime (tsforbidend + ' 23:59:59', '%Y-%m-%d %H:%M:%S')
|
||||
# if datetime.now () <= dttsforbidend:
|
||||
# milkforbid = 1
|
||||
# else:
|
||||
# milkforbid = 1
|
||||
|
||||
retval = ""
|
||||
for ammount, time, mdate, starttime in milkdata:
|
||||
|
||||
Reference in New Issue
Block a user