projects
/
weathermon.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Переделана обработка сообщений MQTT в связи с переходом на прошивку Sonoff-Tasmota...
[weathermon.git]
/
filter_meteo.py
diff --git
a/filter_meteo.py
b/filter_meteo.py
index d4f0e7db8666ea770341255a90137f3ca20e8f15..fc497db694e18e8954dba99651f9f8b46e37cd37 100755
(executable)
--- a/
filter_meteo.py
+++ b/
filter_meteo.py
@@
-35,6
+35,10
@@
def Yesterday():
dt = Today()
return dt - datetime.timedelta(days=1)
dt = Today()
return dt - datetime.timedelta(days=1)
+def Prehistoric():
+ dt = datetime.date(2000,01,01)
+ return dt
+
def GetData(sid,pid,fromDate=Yesterday(),toDate=Today()):
if database:
c = database.cursor()
def GetData(sid,pid,fromDate=Yesterday(),toDate=Today()):
if database:
c = database.cursor()
@@
-55,7
+59,9
@@
def FixRecord(id,value):
def ProcessTable(sid,pid):
def ProcessTable(sid,pid):
- if not current:
+ if process_all:
+ data=GetData(sid,pid,Prehistoric(),Today())
+ elif not current:
data=GetData(sid,pid)
else:
data=GetData(sid,pid,Today(),Tomorrow())
data=GetData(sid,pid)
else:
data=GetData(sid,pid,Today(),Tomorrow())
@@
-90,6
+96,10
@@
if len(sys.argv)==2 and sys.argv[1]=='current':
else:
current=False
else:
current=False
+if len(sys.argv)==2 and sys.argv[1]=='all':
+ process_all=True
+else:
+ process_all=False
try:
try: