Commit d47d58f8 authored by nextime's avatar nextime

Fix a bug in timing filters on actions for how time.locatime()

is managed in python ( 0 is monday in python, 0 is sunday in crons )
parent 7b6996bd
...@@ -76,6 +76,12 @@ ACTION_STATUS={} ...@@ -76,6 +76,12 @@ ACTION_STATUS={}
log = logging.getLogger( 'Core' ) log = logging.getLogger( 'Core' )
def converWday(wday):
wday=wday+1
if wday==7:
wday=0
return wday
class ConvenienceCaller(object): class ConvenienceCaller(object):
""" """
This metaclass build and abstraction of an object instance so This metaclass build and abstraction of an object instance so
...@@ -1358,7 +1364,7 @@ class domotikaService(service.Service): ...@@ -1358,7 +1364,7 @@ class domotikaService(service.Service):
loctime=time.localtime() loctime=time.localtime()
if(loctime.tm_mon in timedict["months"] if(loctime.tm_mon in timedict["months"]
and loctime.tm_mday in timedict["doms"] and loctime.tm_mday in timedict["doms"]
and loctime.tm_wday in timedict["dows"] and converWday(loctime.tm_wday) in timedict["dows"]
and loctime.tm_hour in timedict["hours"] and loctime.tm_hour in timedict["hours"]
and loctime.tm_min in timedict["minutes"]): and loctime.tm_min in timedict["minutes"]):
...@@ -1449,7 +1455,7 @@ class domotikaService(service.Service): ...@@ -1449,7 +1455,7 @@ class domotikaService(service.Service):
loctime=time.localtime() loctime=time.localtime()
if(loctime.tm_mon in timedict["months"] if(loctime.tm_mon in timedict["months"]
and loctime.tm_mday in timedict["doms"] and loctime.tm_mday in timedict["doms"]
and loctime.tm_wday in timedict["dows"] and converWday(loctime.tm_wday) in timedict["dows"]
and loctime.tm_hour in timedict["hours"] and loctime.tm_hour in timedict["hours"]
and loctime.tm_min in timedict["minutes"]): and loctime.tm_min in timedict["minutes"]):
exstep=True exstep=True
...@@ -1627,7 +1633,7 @@ class domotikaService(service.Service): ...@@ -1627,7 +1633,7 @@ class domotikaService(service.Service):
loctime=time.localtime() loctime=time.localtime()
if(loctime.tm_mon in timedict["months"] if(loctime.tm_mon in timedict["months"]
and loctime.tm_mday in timedict["doms"] and loctime.tm_mday in timedict["doms"]
and loctime.tm_wday in timedict["dows"] and converWday(loctime.tm_wday) in timedict["dows"]
and loctime.tm_hour in timedict["hours"] and loctime.tm_hour in timedict["hours"]
and loctime.tm_min in timedict["minutes"]): and loctime.tm_min in timedict["minutes"]):
...@@ -1731,7 +1737,7 @@ class domotikaService(service.Service): ...@@ -1731,7 +1737,7 @@ class domotikaService(service.Service):
loctime=time.localtime() loctime=time.localtime()
if(loctime.tm_mon in timedict["months"] if(loctime.tm_mon in timedict["months"]
and loctime.tm_mday in timedict["doms"] and loctime.tm_mday in timedict["doms"]
and loctime.tm_wday in timedict["dows"] and converWday(loctime.tm_wday) in timedict["dows"]
and loctime.tm_hour in timedict["hours"] and loctime.tm_hour in timedict["hours"]
and loctime.tm_min in timedict["minutes"]): and loctime.tm_min in timedict["minutes"]):
...@@ -1774,7 +1780,7 @@ class domotikaService(service.Service): ...@@ -1774,7 +1780,7 @@ class domotikaService(service.Service):
loctime=time.localtime() loctime=time.localtime()
if(loctime.tm_mon in timedict["months"] if(loctime.tm_mon in timedict["months"]
and loctime.tm_mday in timedict["doms"] and loctime.tm_mday in timedict["doms"]
and loctime.tm_wday in timedict["dows"] and converWday(loctime.tm_wday) in timedict["dows"]
and loctime.tm_hour in timedict["hours"] and loctime.tm_hour in timedict["hours"]
and loctime.tm_min in timedict["minutes"]): and loctime.tm_min in timedict["minutes"]):
...@@ -1812,7 +1818,7 @@ class domotikaService(service.Service): ...@@ -1812,7 +1818,7 @@ class domotikaService(service.Service):
loctime=time.localtime() loctime=time.localtime()
if(loctime.tm_mon in timedict["months"] if(loctime.tm_mon in timedict["months"]
and loctime.tm_mday in timedict["doms"] and loctime.tm_mday in timedict["doms"]
and loctime.tm_wday in timedict["dows"] and converWday(loctime.tm_wday) in timedict["dows"]
and loctime.tm_hour in timedict["hours"] and loctime.tm_hour in timedict["hours"]
and loctime.tm_min in timedict["minutes"]): and loctime.tm_min in timedict["minutes"]):
......
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