Commit e16621c6 authored by nextime's avatar nextime

Few fixes on sequence conditions

parent d6035ba8
...@@ -1104,19 +1104,19 @@ class domotikaService(service.Service): ...@@ -1104,19 +1104,19 @@ class domotikaService(service.Service):
if st[1]=='domain': if st[1]=='domain':
try: try:
ret=doQuery("""SELECT COUNT(value) FROM statusrealtime ret=doQuery("""SELECT COUNT(value) FROM statusrealtime
WHERE DMDOMAIN(status_name, """+str(st[0])+")=1 AND DMDOMAIN(value,'"+st['2']+"')=1", restype) WHERE DMDOMAIN(status_name, '"""+str(st[0])+"')=1 AND DMDOMAIN(value,'"+st['2']+"')=1", restype)
except: except:
pass pass
elif genutils.is_number(st[2]): elif genutils.is_number(st[2]):
try: try:
ret=doQuery("""SELECT COUNT(value) FROM statusrealtime ret=doQuery("""SELECT COUNT(value) FROM statusrealtime
WHERE DMDOMAIN(status_name, """+str(st[0])+")=1 AND CONVERT(value, SIGNED)"+st['1']+st[2], restype) WHERE DMDOMAIN(status_name, '"""+str(st[0])+"')=1 AND CONVERT(value, SIGNED)"+st['1']+st[2], restype)
except: except:
pass pass
elif restype in ['bool','int'] and len(st)==2 and genutils.is_number(st[1]): elif restype in ['bool','int'] and len(st)==2 and genutils.is_number(st[1]):
try: try:
ret=doQuery("""SELECT COUNT(value) FROM statusrealtime ret=doQuery("""SELECT COUNT(value) FROM statusrealtime
WHERE DMDOMAIN(status_name, """+str(st[0])+")=1 AND CONVERT(value, SIGNED)="+st['1'], restype) WHERE DMDOMAIN(status_name, '"""+str(st[0])+"')=1 AND CONVERT(value, SIGNED)="+st['1'], restype)
except: except:
pass pass
elif restype=='string' and len(st)>0: elif restype=='string' and len(st)>0:
...@@ -1133,13 +1133,13 @@ class domotikaService(service.Service): ...@@ -1133,13 +1133,13 @@ class domotikaService(service.Service):
if st[1]=='domain': if st[1]=='domain':
try: try:
ret=doQuery("""SELECT COUNT(value) FROM uniques ret=doQuery("""SELECT COUNT(value) FROM uniques
WHERE DMDOMAIN(name, """+str(st[0])+")=1 AND DMDOMAIN(value,'"+st['2']+"')=1", restype) WHERE DMDOMAIN(name, '"""+str(st[0])+"')=1 AND DMDOMAIN(value,'"+st['2']+"')=1", restype)
except: except:
pass pass
elif genutils.is_number(st[2]): elif genutils.is_number(st[2]):
try: try:
ret=doQuery("""SELECT COUNT(value) FROM uniques ret=doQuery("""SELECT COUNT(value) FROM uniques
WHERE DMDOMAIN(name, """+str(st[0])+")=1 AND CONVERT(value, SIGNED)"+st['1']+st[2], restype) WHERE DMDOMAIN(name, '"""+str(st[0])+"')=1 AND CONVERT(value, SIGNED)"+st['1']+st[2], restype)
except: except:
pass pass
...@@ -1505,6 +1505,7 @@ class domotikaService(service.Service): ...@@ -1505,6 +1505,7 @@ class domotikaService(service.Service):
return return
if usecon: if usecon:
log.info("Sequence condition check (RESULT:"+str(conval)+" CONDITION: "+str(res.condition_act)+" ACTVALUE: "+str(res.condition_actvalue)+")")
if genutils.isTrue(conval): if genutils.isTrue(conval):
if res.condition_act=='GOTOSTEP': if res.condition_act=='GOTOSTEP':
if genutils.is_number(res.condition_actvalue): if genutils.is_number(res.condition_actvalue):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment