How to use the webserver.addFormNumericBox function in webserver

To help you get started, we’ve selected a few webserver examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github enesbcs / rpieasy / _P510_ITag.py View on Github external
def webform_load(self): # create html page for settings
  webserver.addFormTextBox("Device Address","plugin_510_itagaddr",str(self.taskdevicepluginconfig[0]),20)
  webserver.addFormNote("Enable blueetooth then <a href="blescanner">scan iTag address</a> first.")
  webserver.addFormNumericBox("Reconnect time","plugin_510_reconnect",self.taskdevicepluginconfig[1],5,240)
  webserver.addUnit("s")
  return True
github enesbcs / rpieasy / _C022_ESPNow.py View on Github external
else:
   ts = str(taskstr).split(",")
   cs = str(confstr).split(",")
  pp = -1
  for p in range(len(pluginparams)):
   if int(pluginparams[p]["pluginid"])==int(ts[2]):
    pp = p
    break
  options = []
  optionvalues = []
  for p in range(len(pluginparams)):
    options.append(pluginparams[p]["name"])
    optionvalues.append(pluginparams[p]["pluginid"])
  webserver.addFormSelector("Plugin","pluginid",len(options),options,optionvalues,None,int(ts[2]))
  webserver.addFormNumericBox("Interval","interval",int(ts[7]),0,32768)
  webserver.addFormNumericBox("IDX","idx",int(ts[8]),0,32768)
  if pp>-1:
   try:
    options = []
    optionvalues = []
    for p in range(17):
     options.append("GPIO"+str(p))
     optionvalues.append(p)
    for i in range(0,pluginparams[pp]["pins"]):
     webserver.addFormSelector("Pin"+str(i+1),"pin"+str(i+1),len(options),options,optionvalues,None,int(ts[3+i]))
   except:
    pass
   try:
    if pluginparams[pp]["ports"]>0:
     webserver.addFormNumericBox("Port","port",int(ts[6]),0,32768)
   except:
    pass
github enesbcs / rpieasy / _P023_OLED.py View on Github external
webserver.addFormSelector("Mode","p023_rotate",len(optionvalues),options,optionvalues,None,choice3)
  options = ["Default","128x64","128x128","128x32","96x96","96x64","64x48","64x32"]
  choice4 = self.taskdevicepluginconfig[3] # store resolution
  webserver.addHtml("Resolution:")
  webserver.addSelector_Head("p023_res",False)
  for d in range(len(options)):
   webserver.addSelector_Item(options[d],options[d],(choice4==options[d]),False)
  webserver.addSelector_Foot()

  choice5 = int(float(self.taskdevicepluginconfig[4])) # store line count
  webserver.addHtml("Number of lines:")
  webserver.addSelector_Head("p023_linecount",False)
  for l in range(1,self.P23_Nlines+1):
   webserver.addSelector_Item(str(l),l,(l==choice5),False)
  webserver.addSelector_Foot()
  webserver.addFormNumericBox("Try to display # characters per row","p023_charperl",self.taskdevicepluginconfig[5],1,32)
  webserver.addFormNote("Leave it '1' if you do not care")
  webserver.addFormCheckBox("Clear only used lines","p023_partialclear",self.taskdevicepluginconfig[6])
  if choice5 &gt; 0 and choice5&lt;9:
   lc = choice5
  else:
   lc = self.P23_Nlines
  for l in range(lc):
   try:
    linestr = self.lines[l]
   except:
    linestr = ""
   webserver.addFormTextBox("Line"+str(l+1),"p023_template"+str(l),linestr,128)

  return True
github enesbcs / rpieasy / _P008_Wiegand_RFID.py View on Github external
def webform_load(self):
  choice1 = self.taskdevicepluginconfig[0]
  options = ["RAW","SHA1 encoded","SHA1 encoded except starting with 0"]
  optionvalues = [0,1,2]
  webserver.addFormSelector("Sending format","p008_format",3,options,optionvalues,None,choice1)
  webserver.addFormNumericBox("Expected PIN digits","p008_minlen",self.taskdevicepluginconfig[1],0,10)
  webserver.addFormNumericBox("Maximal card bit length","p008_maxlen",self.taskdevicepluginconfig[2],0,34)
  return True
github enesbcs / rpieasy / _N001_Email.py View on Github external
def webform_load(self): # create html page for settings
  webserver.addFormTextBox("Server","server",self.server,64)
  options = ["Plain","SSL"]
  optionvalues = [0,1]
  webserver.addFormSelector("Protocol","security",len(options),options,optionvalues,None,self.security)
  webserver.addFormNumericBox("Port","port",self.port,1,65535)
  webserver.addFormTextBox("Sender","sender",self.sender,64)
  webserver.addFormTextBox("Receiver","receiver",self.receiver,64)
  webserver.addFormTextBox("SMTP login name","login",self.login,64)
  webserver.addFormPasswordBox("STMP password","passw",self.passw,64)
  webserver.addFormTextBox("Subject","subject",self.subject,64)
  webserver.addHtml("Body:<textarea wrap="off" size="512" cols="80" rows="5">")
  webserver.addHtml(str(self.body))
  webserver.addHtml("</textarea>")
  return True
github enesbcs / rpieasy / _C022_ESPNow.py View on Github external
nodenum = -1
     if nodenum!=-1:
      webserver.addFormNumericBox("Unit number","nnodenum",nodenum,1,254)

     dnodenum = -1
     commands.doExecuteCommand("serialcommand,espnow,dest",False)
     time.sleep(1)
     scmdarr = getlastseriallogs(3)
     if len(scmdarr)>2:
      if ",dest" in scmdarr[2]:
       dnodenum = scmdarr[1].replace("SERIAL: ","").strip()
       try:
        dnodenum = int(dnodenum)
       except:
        dnodenum = -1
     webserver.addFormNumericBox("Destination node number","dnodenum",dnodenum,0,254)

     sdat = ""
     commands.doExecuteCommand("serialcommand,espnow,name",False)
     time.sleep(1)
     scmdarr = getlastseriallogs(3)
     if len(scmdarr)>2:
      if ",name" in scmdarr[2]:
       sdat = scmdarr[1].replace("SERIAL: ","").strip()
     webserver.addFormTextBox("Unit name","name",sdat,25)

     wchan = -1
     commands.doExecuteCommand("serialcommand,espnow,chan",False)
     time.sleep(1)
     scmdarr = getlastseriallogs(3)
     if len(scmdarr)>2:
      if ",chan" in scmdarr[2]:
github enesbcs / rpieasy / _C021_BLEDirect.py View on Github external
webserver.addFormNote("IP and Port parameter is not used!")
  webserver.addFormNote("<a href="https://github.com/enesbcs/ESPEasyRetro/blob/master/ESPEasyRetro/_C021.ino">ESP32 reference controller</a>")

  webserver.addFormCheckBox("Enable Receiver Service","receiver",self.enablerec)
  webserver.addFormNote("Enable this for Gateway/Repeater unit, Disable if you only want to send data!")
  try:
   if self.bleserv is not None:
    webserver.addFormNote("Current Address: "+str(self.bleserv.getaddress()))
  except:
   pass
  webserver.addFormCheckBox("Enable Sending to Default Master Unit","sender",self.enablesend)
  webserver.addFormCheckBox("Enable Direct Sending to Units in P2P list","directsender",self.directsend)
  webserver.addFormNote("Please respect MASTER-SLAVE nature of BLE and do not create infinite loops!")
  webserver.addFormTextBox("Default BLE Master Unit address","masteraddress",self.defaultdestination,23)
  webserver.addFormNote("Enable bluetooth then <a href="blescanner">scan RPIEasy BLE address</a> first.")
  webserver.addFormNumericBox("Default destination node index","defaultnode",self.defaultunit,0,255)
  webserver.addFormNote("Default node index for data sending, only used when Master Unit address is setted")
  return True
github enesbcs / rpieasy / _P073_7DGT.py View on Github external
def webform_load(self): # create html page for settings
   webserver.addFormNote("TM1637:  1st GPIO=CLK-Pin, 2nd GPIO=DIO-Pin")

   choice1 = self.taskdevicepluginconfig[0] # store display type
   options = ["TM1637 - 4 digit (colon)","TM1637 - 4 digit (dots)"]
   optionvalues = [self.P073_TM1637_4DGTCOLON,self.P073_TM1637_4DGTDOTS]
   webserver.addFormSelector("Display Type","p073_type",len(optionvalues),options,optionvalues,None,choice1)

   choice2 = self.taskdevicepluginconfig[1]
   options = ["Manual","Clock 24h - Blink","Clock 24h - No Blink","Clock 12h - Blink","Clock 12h - No Blink","Date"]
   optionvalues = [self.P073_DISP_MANUAL,self.P073_DISP_CLOCK24BLNK,self.P073_DISP_CLOCK24,self.P073_DISP_CLOCK12BLNK,self.P073_DISP_CLOCK12,self.P073_DISP_DATE]
   webserver.addFormSelector("Display Output","p073_output",len(optionvalues),options,optionvalues,None,choice2)

   webserver.addFormNumericBox("Brightness", "p073_brightness", self.taskdevicepluginconfig[2], 0, 15)
   return True
github enesbcs / rpieasy / _P019_PCF8574.py View on Github external
def webform_load(self): # create html page for settings
  try:
   if self.pcf.externalintsetted:
    self.taskdevicepin[0]=self.pcf.extinta
  except Exception as e:
   pass
  webserver.addFormPinSelect("PCF interrupt","taskdevicepin0",self.taskdevicepin[0])
  webserver.addFormNote("Add one RPI INPUT-PULLUP pin to handle input changes immediately - not needed for interval input reading and output using")
  webserver.addFormNumericBox("Port","p019_pnum",self.taskdevicepluginconfig[0],1,128)
  webserver.addFormNote("First extender 1-8 (0x20), Second 9-16 (0x21)...")
  choice2 = self.taskdevicepluginconfig[1]
  options = ["Input","Output"]
  optionvalues = [0,2]
  webserver.addFormSelector("Type","p019_ptype",len(optionvalues),options,optionvalues,None,int(choice2))
  return True