mirror of https://github.com/noisymime/OSPi.git
Merged from JM_from_remote, Fixed bugs in JM initial Prototype.
This commit is contained in:
parent
cdb27826c9
commit
2f86577398
6
ospi.py
6
ospi.py
|
@ -405,7 +405,7 @@ except IOError: # If file does not exist, create with defaults.
|
|||
"lr": "100", "sdt": 0, "mas": 0, "wl": 100, "bsy": 0, "lg": "",
|
||||
"urs": 0, "nopts": 13, "pwd": "b3BlbmRvb3I=", "ipas": 0, "rst": 1,
|
||||
"mm": 0, "mo": [0], "rbt": 0, "mtoff": 0, "nprogs": 1, "nbrd": 1, "tu": "C",
|
||||
"snlen":32, "name":"OpenSprinkler Pi"})
|
||||
"snlen":32, "name":u"OpenSprinkler Pi",})
|
||||
sdf = open('./data/sd.json', 'w')
|
||||
json.dump(gv.sd, sdf)
|
||||
sdf.close()
|
||||
|
@ -586,6 +586,7 @@ class change_options:
|
|||
"""Save changes to options made on the options page."""
|
||||
def GET(self):
|
||||
qdict = web.input()
|
||||
print 'qdict', qdict
|
||||
try:
|
||||
if gv.sd['ipas'] == 0 and qdict['pw'] != base64.b64decode(gv.sd['pwd']):
|
||||
raise web.unauthorized()
|
||||
|
@ -614,6 +615,7 @@ class change_options:
|
|||
gv.sd['sdt']= int(qdict['osdt'])
|
||||
|
||||
gv.sd['mas'] = int(qdict['omas'])
|
||||
#gv.sd['mas'] = int(qdict['mas'])
|
||||
gv.sd['mton']= int(qdict['omton'])
|
||||
gv.sd['mtoff']= int(qdict['omtoff'])
|
||||
gv.sd['wl'] = int(qdict['owl'])
|
||||
|
@ -707,7 +709,7 @@ class change_options:
|
|||
##=======
|
||||
gv.sbits.append(0)
|
||||
elif int(qdict['onbrd'])+1 < gv.sd['nbrd']: # Shorten lists
|
||||
onbrd = qdict['onbrd']
|
||||
onbrd = int(qdict['onbrd'])
|
||||
decr = gv.sd['nbrd'] - (onbrd+1)
|
||||
gv.sd['mo'] = gv.sd['mo'][:(onbrd+1)]
|
||||
gv.sd['ir'] = gv.sd['ir'][:(onbrd+1)]
|
||||
|
|
|
@ -16,7 +16,7 @@ function submit_form(f) {
|
|||
f.elements["otz"].value=((th+12)*4)>>0;
|
||||
f.elements["ohtp"].value=(f.elements["htp"].value)&0xff;
|
||||
f.elements["ohtp2"].value=(f.elements["htp"].value>>8)&0xff;
|
||||
f.elements["omas"].value=f.elements["mas"].value;
|
||||
//f.elements["omas"].value=f.elements["mas"].value;
|
||||
f.submit();
|
||||
}
|
||||
function fcancel() {window.location="/";}
|
||||
|
@ -56,8 +56,8 @@ for(oid=0;oid<opts.length;oid++){
|
|||
w(":<input type=text size=3 maxlength=3 value="+((Math.abs(tz)%4)*15/10>>0)+((Math.abs(tz)%4)*15%10)+" name=tq>");
|
||||
break;
|
||||
case "mas":
|
||||
w("<input type=hidden value=0 name=o"+name+">");
|
||||
w("<p title=\""+tooltip+"\"><b>"+label+":</b> <select name=mas><option "+(value==0?" selected ":" ")+"value=0>None</option>");
|
||||
//w("<input type=hidden value=0 name=o"+name+">");
|
||||
w("<p title=\""+tooltip+"\"><b>"+label+":</b> <select name=o"+name+"><option "+(value==0?" selected ":" ")+"value=0>None</option>");
|
||||
for(i=1;i<=8;i++) w("<option "+(value==i?" selected ":" ")+"value="+i+">Station 0"+i+"</option>");
|
||||
w("</select>");
|
||||
break;
|
||||
|
|
Loading…
Reference in New Issue