示例#1
0
 def webform_load(self):  # create html page for settings
     webserver.addFormTextBox("Controller Publish", "inchannel",
                              self.inchannel, 255)
     webserver.addFormTextBox("Controller Subscribe", "outchannel",
                              self.outchannel, 255)
     try:
         kp = self.keepalive
     except:
         kp = 60
     webserver.addFormNumericBox("Keepalive time", "keepalive", kp, 2, 600)
     webserver.addUnit("s")
     try:
         am = self.authmode
         fname = self.certfile
     except:
         am = 0
         fname = ""
     options = ["MQTT", "MQTTS/with cert", "MQTTS/insecure"]
     optionvalues = [0, 1, 2]
     webserver.addFormSelector("Mode", "c002_mode", len(optionvalues),
                               options, optionvalues, None, int(am))
     webserver.addFormTextBox("Server certificate file", "c002_cert",
                              str(fname), 120)
     webserver.addBrowseButton("Browse", "c002_cert", startdir=str(fname))
     webserver.addFormNote(
         "Upload certificate first at <a href='filelist'>filelist</a> then select here!"
     )
     return True
示例#2
0
 def webform_load(self):
  if Settings.SoundSystem["usable"]==False:
   webserver.addHtml("<tr><td><td><font color='red'>The sound system can not be used!</font>")
  else:
   maxlevel = rpieGlobals.PLUGIN_CONFIGVAR_MAX
   if maxlevel>10:
    maxlevel = 10
   for c in range(1,maxlevel+1):
    webserver.addFormTextBox("Level "+str(c*10),"p505_lvl_"+str(c*10),str(self.taskdevicepluginconfig[c]),180)
    webserver.addBrowseButton("Browse","p505_lvl_"+str(c*10),startdir=str(self.taskdevicepluginconfig[c]))
   webserver.addFormNote("Specify file names/network URI for every level, that is needed!")
  return True
示例#3
0
 def webform_load(self):
     if Settings.SoundSystem["usable"] == False:
         webserver.addHtml(
             "<tr><td><td><font color='red'>The sound system can not be used!</font>"
         )
     else:
         webserver.addFormTextBox("Directory", "p503_dir",
                                  str(self.taskdevicepluginconfig[0]), 120)
         webserver.addBrowseButton("Browse",
                                   "p503_dir",
                                   startdir=str(
                                       self.taskdevicepluginconfig[0]))
         webserver.addFormNote(
             "Specify directory where .MP3 files located!")
     return True
示例#4
0
 def webform_load(self):
     if Settings.SoundSystem["usable"] == False:
         webserver.addHtml(
             "<tr><td><td><font color='red'>The sound system can not be used!</font>"
         )
     else:
         maxlevel = rpieGlobals.PLUGIN_CONFIGVAR_MAX
         if maxlevel > 10:
             maxlevel = 10
         for c in range(1, maxlevel + 1):
             webserver.addFormTextBox("Level " + str(c * 10),
                                      "p502_lvl_" + str(c * 10),
                                      str(self.taskdevicepluginconfig[c]),
                                      120)
             webserver.addBrowseButton("Browse",
                                       "p502_lvl_" + str(c * 10),
                                       startdir=str(
                                           self.taskdevicepluginconfig[c]))
         webserver.addFormNote(
             "Specify file names with relative pathname for every level, that is needed!"
         )
         optionvalues = []
         options = []
         for i in range(-1, 20):
             optionvalues.append(i)
             if i == -1:
                 options.append("Forever")
             else:
                 options.append(str(i))
         try:
             loop = int(self.loopcount)
         except:
             self.loopcount = -1
             loop = -1
         webserver.addFormSelector("Loop count", "p502_loop",
                                   len(optionvalues), options, optionvalues,
                                   None, loop)
         webserver.addFormNote(
             "Default is Forever in this mode sound will repeat until LEVEL 0 asked. As it is running in background there is no way you know if playing is ended actually if using specific loop count!"
         )
     return True
示例#5
0
 def webform_load(self):  # create html page for settings
     webserver.addFormTextBox("Report topic", "inchannel", self.inchannel,
                              255)
     webserver.addFormTextBox("Command topic", "outchannel",
                              self.outchannel, 255)
     try:
         kp = self.keepalive
     except:
         kp = 60
     webserver.addFormNumericBox("Keepalive time", "keepalive", kp, 2, 600)
     webserver.addUnit("s")
     try:
         am = self.authmode
         fname = self.certfile
     except:
         am = 0
         fname = ""
     options = ["MQTT", "MQTTS/with cert", "MQTTS/insecure"]
     optionvalues = [0, 1, 2]
     webserver.addFormSelector("Mode", "c014_mode", len(optionvalues),
                               options, optionvalues, None, int(am))
     webserver.addFormTextBox("Server certificate file", "c014_cert",
                              str(fname), 120)
     webserver.addBrowseButton("Browse", "c014_cert", startdir=str(fname))
     webserver.addFormNote(
         "Upload certificate first at <a href='filelist'>filelist</a> then select here!"
     )
     try:
         lwt = self.lwt_topic
         lwt1 = self.lwtconnmsg
         lwt2 = self.lwtdisconnmsg
     except:
         lwt = "%sysname%/LWT"
         lwt1 = "Online"
         lwt2 = "Offline"
     webserver.addFormTextBox("Controller lwl topic", "c014_lwt", lwt, 255)
     webserver.addFormTextBox("LWT Connect Message", "c014_cmsg", lwt1, 255)
     webserver.addFormTextBox("LWT Disconnect Message", "c014_dcmsg", lwt2,
                              255)
     return True