OpenSprinkler › Forums › Hardware Questions › OpenSprinkler Pi (OSPi) › HTML API differences beteen OpenSprinkler and OSPi › Re: Re: HTML API differences beteen OpenSprinkler and OSPi
Dan in CA
I took a look and what was going on and made a couple of changes to the Interval program. The fixes will be in the next update but if you want to make the changes now, they are:
issues #1 an #2.
replace the set_station class (~line 642) with:
"""turn a station (valve/zone) on=1 or off=0 in manual mode."""
def GET(self, nst, t=None): # nst = station number, status, optional duration
nstlst = [int(i) for i in re.split('=|&t=', nst)]
if len(nstlst) == 2:
sid = int(nstlst)-1 # station index
b = sid/8 #board index
if nstlst == 1 and gv.sd: # if status is on and manual mode is set
gv.rs[sid] = time.time() # set start time to current time
if nstlst: # if an optional duration time is given
gv.rs[sid] = nstlst
gv.rs[sid] = gv.rs[sid] + nstlst # stop time = start time + duration
gv.rs[sid] = float('inf') # stop time = infinity
gv.rs[sid] = 99 # set program index
gv.ps[sid] = nstlst
if nstlst == 0 and gv.sd: # If status is off
gv.rs[sid] = time.time()
Int the Get_Station class (~line 628), comment out or delete the following line:
status = 'n'
Modify the ine after that to change += to just =:
status = ''.join(str(x) for x in gv.srvals)
The doctype line was originally added to make the program work with webkit browsers such as Chrome. I just tested this in chrome and it is working as expected.