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:

class set_station:
"""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[0])-1 # station index
b = sid/8 #board index
if nstlst[1] == 1 and # if status is on and manual mode is set[sid][0] = time.time() # set start time to current time
if nstlst[2]: # if an optional duration time is given[sid][2] = nstlst[2][sid][1] =[sid][0] + nstlst[2] # stop time = start time + duration
else:[sid][1] = float('inf') # stop time = infinity[sid][3] = 99 # set program index[sid][1] = nstlst[2]
if nstlst[1] == 0 and # If status is off[sid][1] = time.time()
raise web.seeother('/')

Issue #3:
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.