def webform_load(self): # create html page for settings webserver.addFormTextBox("Device Address", "plugin_515_addr", str(self.taskdevicepluginconfig[0]), 20) webserver.addFormNote( "Enable blueetooth then <a href='blescanner'>scan 'Flower care' address</a> first." ) choice1 = self.taskdevicepluginconfig[1] choice2 = self.taskdevicepluginconfig[2] choice3 = self.taskdevicepluginconfig[3] choice4 = self.taskdevicepluginconfig[4] options = [ "None", "Temperature", "Brightness", "Moisture", "Conductivity", "Battery" ] optionvalues = [0, 1, 2, 3, 4, 5] webserver.addFormSelector("Indicator1", "plugin_515_ind0", len(options), options, optionvalues, None, choice1) webserver.addFormSelector("Indicator2", "plugin_515_ind1", len(options), options, optionvalues, None, choice2) webserver.addFormSelector("Indicator3", "plugin_515_ind2", len(options), options, optionvalues, None, choice3) webserver.addFormSelector("Indicator4", "plugin_515_ind3", len(options), options, optionvalues, None, choice4) return True
def webform_load(self): 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
def webform_load(self): # create html page for settings bledevs = BLEHelper.find_hci_devices() options = [] optionvalues = [] if bledevs: for bd in bledevs: options.append(bd) try: optionvalues.append(int(bd[3:])) except: optionvalues.append(bd[3:]) webserver.addFormSelector("Local Device", "plugin_520_dev", len(options), options, optionvalues, None, int(self.taskdevicepluginconfig[2])) webserver.addFormTextBox("Remote Device Address", "plugin_520_addr", str(self.taskdevicepluginconfig[0]), 20) webserver.addFormCheckBox("Add RSSI value for non-Domoticz system", "plugin_520_rssi", self.taskdevicepluginconfig[1]) webserver.addFormNote( "For Domoticz it's integrated with online value!") webserver.addFormFloatNumberBox("Timeout", "plugin_520_tout", float(self.taskdevicepluginconfig[3]), 0, 60) webserver.addUnit("s") options = ["State", "State or RSSI"] optionvalues = ["0", "1"] webserver.addFormSelector("Report on change of", "plugin_520_rep", len(options), options, optionvalues, None, int(self.taskdevicepluginconfig[4])) return True
def webform_load(self): # create html page for settings bledevs = BLEHelper.find_hci_devices() options = [] optionvalues = [] if bledevs: for bd in bledevs: options.append(bd) try: optionvalues.append(int(bd[3:])) except: optionvalues.append(bd[3:]) webserver.addFormSelector("Local Device", "plugin_517_dev", len(options), options, optionvalues, None, int(self.taskdevicepluginconfig[2])) webserver.addFormTextBox("Device Address", "plugin_517_addr", str(self.taskdevicepluginconfig[0]), 20) webserver.addFormNote( "Enable blueetooth then <a href='blescanner'>scan LYWSD03 address</a> first." ) webserver.addFormCheckBox("Add Battery value for non-Domoticz system", "plugin_517_bat", self.taskdevicepluginconfig[1]) # webserver.addFormCheckBox("Connect only if BLE local device free","plugin_517_free",self.taskdevicepluginconfig[3]) webserver.addFormNote( "Check if you are using multiple devices and interferences occurs between them." ) return True
def webform_load(self): # create html page for settings webserver.addFormTextBox("Device Address", "plugin_516_addr", str(self.taskdevicepluginconfig[0]), 20) webserver.addFormNote( "Enable blueetooth then <a href='blescanner'>scan EQ3 address</a> first." ) return True
def webform_load(self): # create html page for settings webserver.addFormTextBox("RTSP stream", "plugin_522_url", str(self.taskdevicepluginconfig[0]), 255) webserver.addFormNote( "Specify the full URL to access stream, with password if needed") webserver.addFormCheckBox("Enable resize", "plugin_522_resize", self.taskdevicepluginconfig[1]) webserver.addFormNumericBox("Width to resize", "plugin_522_w", self.taskdevicepluginconfig[2], 0, 4096) webserver.addFormNumericBox("Height to resize", "plugin_522_h", self.taskdevicepluginconfig[3], 0, 2160) webserver.addFormNote( "Resize is a bit resource hungry, use only if really needed") try: if self.initialized and self.enabled: try: pname = self.gettaskname() except: pname = "" if pname == "": pname = "[NAME]" url = "image?name=" + str(pname) webserver.addHtml("<tr><td>Output image url:</td>") if pname == "[NAME]": webserver.addHtml("<td>http://ipaddress:port/image?name=" + pname) else: webserver.addHtml("<td><a href='" + url + "'>/" + url + "</a></td></tr>") except: pass return True
def webform_load(self): global backends if self.provider == 0: webserver.addFormNote("Server address and port is not used.") self.controllerport = 1 self.controllerip = "localhost" self.usesAccount = False self.usesPassword = False elif self.provider == 1: self.usesAccount = True self.usesPassword = True if self.controllerport in [0, 1, 80]: self.controllerport = 3306 try: options = backends optionvalues = [0, 1] webserver.addFormSelector("DB Type", "c016_type", len(options), options, optionvalues, None, int(self.provider), reloadonchange=True) except: pass webserver.addFormTextBox("Database name", "c016_dbname", str(self.dbname), 255) return True
def webform_load(self): # create html page for settings choice1 = str(self.taskdevicepluginconfig[0]) # store display type options = [ '1.54" (200x200)', '1.54"B (200x200)', '1.54"C (150x150)', '2.13" (250x122)', '2.13"B (212x104)', '2.7" (264x176)', '2.7"B (264x176)', '2.9" (296x128)', '2.9"B (296x128)', '4.2" (400x300)', '4.2"B (400x300)', '7.5" (800x480)', '7.5"B (800x480)' ] optionvalues = [ "154", "154b", "154c", "213", "213b", "270", "270b", "290", "290b", "420", "420b", "750", "750b" ] webserver.addHtml("<tr><td>Display type:<td>") webserver.addSelector_Head("p205_type", False) for d in range(len(options)): webserver.addSelector_Item(options[d], optionvalues[d], (str(choice1) == str(optionvalues[d])), False) webserver.addSelector_Foot() webserver.addFormNote("Enable <a href='pinout'>SPI-0</a> first!") webserver.addFormNote( "Hardware connection (OLED => Raspberry Pi)<br>VCC->3.3V, GND->GND, SDI->MOSI, SCLK->SCLK, CS-> GPIO8/CE0, D/C->GPIO25 (out), RES->GPIO17 (out), BUSY->GPIO24 (in)" ) choice3 = int(float( self.taskdevicepluginconfig[2])) # store rotation state options = ["Normal", "Rotate by 90", "Rotate by 180", "Rotate by 270"] optionvalues = [0, 1, 2, 3] webserver.addFormSelector("Mode", "p205_rotate", len(optionvalues), options, optionvalues, None, choice3) choice5 = int(float( self.taskdevicepluginconfig[4])) # store line count webserver.addHtml("<tr><td>Number of lines:<td>") webserver.addSelector_Head("p205_linecount", False) for l in range(1, self.P205_Nlines + 1): webserver.addSelector_Item(str(l), l, (l == choice5), False) webserver.addSelector_Foot() webserver.addFormNumericBox("Try to display # characters per row", "p205_charperl", self.taskdevicepluginconfig[5], 1, 32) webserver.addFormNote("Leave it '1' if you do not care") webserver.addFormCheckBox("Clear only used lines", "p205_partialclear", self.taskdevicepluginconfig[6]) if choice5 > 0 and choice5 < 9: lc = choice5 else: lc = self.P205_Nlines for l in range(lc): try: linestr = self.lines[l] except: linestr = "" webserver.addFormTextBox("Line" + str(l + 1), "p205_template" + str(l), linestr, 128) return True
def webform_load(self): # create html page for settings webserver.addFormTextBox("Server","server",self.server,128) webserver.addFormNumericBox("Port","port",self.port,1,65535) webserver.addFormPasswordBox("Token","passw",self.passw,64) webserver.addFormTextBox("Chat-id","chatid",self.chatid,255) webserver.addHtml("<TR><TD>Body:<TD><textarea name='body' rows='5' cols='80' size=255 wrap='off'>") webserver.addHtml(str(self.body)) webserver.addHtml("</textarea>") return True
def webform_load(self): webserver.addFormTextBox("Command 0", "plugin_511_cmd0", str(self.taskdevicepluginconfig[0]), 512) webserver.addFormTextBox("Command 1", "plugin_511_cmd1", str(self.taskdevicepluginconfig[1]), 512) webserver.addFormNote( "Specify OS commands that has to be executed at the speficied state (0/1)" ) return True
def webform_load(self): webserver.addFormTextBox("Remote station address", "plugin_126_addr", str(self.taskdevicepluginconfig[0]), 128) webserver.addFormFloatNumberBox("Timeout", "plugin_126_timeout", float(self.taskdevicepluginconfig[1]), 0, 20) webserver.addUnit("s") webserver.addFormNote("Ping3 icmp will only work with ROOT rights!") return True
def webform_load(self): # create html page for settings webserver.addFormTextBox("Teams channel Webhook URL", "fullurl", self.fullurl, 512) webserver.addHtml( "<TR><TD>Body:<TD><textarea name='body' rows='5' cols='80' size=255 wrap='off'>" ) webserver.addHtml(str(self.body)) webserver.addHtml("</textarea>") return True
def webform_load(self): # create html page for settings webserver.addFormTextBox("Device Address", "plugin_513_addr", str(self.taskdevicepluginconfig[0]), 20) webserver.addFormNote( "Enable blueetooth then <a href='blescanner'>scan LYWSD02 address</a> first." ) webserver.addFormCheckBox("Add Battery value for non-Domoticz system", "plugin_513_bat", self.taskdevicepluginconfig[1]) return True
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
def webform_load(self): webserver.addFormTextBox("Command 0", "plugin_511_cmd0", str(self.taskdevicepluginconfig[0]), 512) webserver.addFormTextBox("Command 1", "plugin_511_cmd1", str(self.taskdevicepluginconfig[1]), 512) webserver.addFormNote( "Specify OS commands that has to be executed at the speficied state (0/1)" ) webserver.addFormCheckBox("Use threading to run in background", "plugin_511_th", self.taskdevicepluginconfig[2]) return True
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
def webform_load(self): # create html page for settings bledevs = BLEHelper.find_hci_devices() options = [] optionvalues = [] if bledevs: for bd in bledevs: options.append(bd) try: optionvalues.append(int(bd[3:])) except: optionvalues.append(bd[3:]) webserver.addFormSelector("Local Device","plugin_527_dev",len(options),options,optionvalues,None,int(self.taskdevicepluginconfig[4])) webserver.addFormTextBox("Remote Device Address","plugin_527_addr",str(self.address),20) webserver.addFormNote("Supported device types: LYWSD02, CGQ, CGG1, MiFlora") webserver.addFormNote("If you are using Sniffer, its not the best idea to use another BLE plugin at the same time. Although multiple sniffer tasks can be used.") choice1 = self.taskdevicepluginconfig[0] choice2 = self.taskdevicepluginconfig[1] choice3 = self.taskdevicepluginconfig[2] choice4 = self.taskdevicepluginconfig[3] options = ["None","Temperature","Humidity","Light","Moisture","Fertility","Battery","RSSI"] optionvalues = [-1,4,6,7,8,9,10,200] webserver.addFormSelector("Indicator1","plugin_527_ind0",len(optionvalues),options,optionvalues,None,choice1) webserver.addFormSelector("Indicator2","plugin_527_ind1",len(optionvalues),options,optionvalues,None,choice2) webserver.addFormSelector("Indicator3","plugin_527_ind2",len(optionvalues),options,optionvalues,None,choice3) webserver.addFormSelector("Indicator4","plugin_527_ind3",len(optionvalues),options,optionvalues,None,choice4) try: if self.taskdevicepluginconfig[5]<1: self.taskdevicepluginconfig[5] = self.blescanner.scantime except: pass try: if self.taskdevicepluginconfig[6]<1: self.taskdevicepluginconfig[6] = self.blescanner.minsleep except: pass try: if self.taskdevicepluginconfig[7]<1: self.taskdevicepluginconfig[7] = self.blescanner.maxsleep except: pass if self.taskdevicepluginconfig[5]<1: self.taskdevicepluginconfig[5]=5 if self.taskdevicepluginconfig[6]<1: self.taskdevicepluginconfig[6]=10 if self.taskdevicepluginconfig[7]<1: self.taskdevicepluginconfig[7]=30 webserver.addFormNumericBox("Scan time","plugin_527_scantime",self.taskdevicepluginconfig[5],5,60) webserver.addUnit('s') webserver.addFormNumericBox("Minimal pause after scan","plugin_527_minsleep",self.taskdevicepluginconfig[6],5,60) webserver.addUnit('s') webserver.addFormNumericBox("Maximal pause after scan","plugin_527_maxsleep",self.taskdevicepluginconfig[7],10,120) webserver.addUnit('s') return True
def webform_load(self): # create html page for settings choice1 = str(self.taskdevicepluginconfig[0]) # store display type import luma.oled.device options = luma.oled.device.__all__ webserver.addHtml("<tr><td>Display type:<td>") webserver.addSelector_Head("p036_type",True) for d in range(len(options)): webserver.addSelector_Item(options[d],options[d],(choice1==options[d]),False) webserver.addSelector_Foot() choice2 = int(float(self.taskdevicepluginconfig[1])) # store i2c address options = ["0x3c","0x3d"] optionvalues = [0x3c,0x3d] webserver.addFormSelector("Address","p036_adr",len(options),options,optionvalues,None,choice2) webserver.addFormNote("Enable <a href='pinout'>I2C bus</a> first, than <a href='i2cscanner'>search for the used address</a>!") choice3 = int(float(self.taskdevicepluginconfig[2])) # store rotation state options = ["Normal","Rotate by 180"] optionvalues = [0,2] webserver.addFormSelector("Mode","p036_rotate",len(optionvalues),options,optionvalues,None,choice3) options = ["Default","128x64","128x128","128x32","96x96","96x64","64x48","64x32"] choice4 = self.taskdevicepluginconfig[3] # store resolution webserver.addHtml("<tr><td>Resolution:<td>") webserver.addSelector_Head("p036_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("<tr><td>Lines per Frame:<td>") webserver.addSelector_Head("p036_linecount",False) for l in range(1,5): webserver.addSelector_Item(str(l),l,(l==choice5),False) webserver.addSelector_Foot() choice6 = int(float(self.taskdevicepluginconfig[5])) # transition speed options = ["Very Slow","Slow","Fast","Very Fast","Instant"] optionvalues = [1,2,4,8,32] webserver.addFormSelector("Scroll","p036_scroll",len(optionvalues),options,optionvalues,None,choice6) for l in range(self.P36_Nlines): try: linestr = self.lines[l] except: linestr = "" webserver.addFormTextBox("Line"+str(l+1),"p036_template"+str(l),linestr,128) choice7 = int(float(self.taskdevicepluginconfig[6])) # contrast options = ["Low","Medium","High"] optionvalues = [self.P36_CONTRAST_LOW, self.P36_CONTRAST_MED, self.P36_CONTRAST_HIGH] webserver.addFormSelector("Contrast","p036_contrast",len(optionvalues),options,optionvalues,None,choice7) webserver.addFormNumericBox("Try to display # characters per row","p036_charperl",self.taskdevicepluginconfig[7],1,32) webserver.addFormNote("Leave it '1' if you do not care") webserver.addFormPinSelect("Display button", "p036_button", self.taskdevicepin[0]) return True
def webform_load(self): # create html page for settings choice1 = str(self.taskdevicepluginconfig[0]) # store display type options = ["PCF8574","MCP23008","MCP23017","MCP23017/B"] webserver.addHtml("<tr><td>I2C chip type:<td>") webserver.addSelector_Head("p012_type",True) for d in range(len(options)): webserver.addSelector_Item(options[d],options[d],(choice1==options[d]),False) webserver.addSelector_Foot() choice2 = int(float(self.taskdevicepluginconfig[1])) # store i2c address optionvalues = [] for i in range(0x20,0x28): optionvalues.append(i) for i in range(0x38,0x40): optionvalues.append(i) options = [] for i in range(len(optionvalues)): options.append(str(hex(optionvalues[i]))) webserver.addFormSelector("Address","p012_adr",len(options),options,optionvalues,None,choice2) webserver.addFormNote("Enable <a href='pinout'>I2C bus</a> first, than <a href='i2cscanner'>search for the used address</a>!") choice3 = self.taskdevicepluginconfig[2] # store resolution webserver.addHtml("<tr><td>Resolution:<td>") webserver.addSelector_Head("p012_res",False) options = ["16x2","20x4"] for d in range(len(options)): webserver.addSelector_Item(options[d],options[d],(choice3==options[d]),False) webserver.addSelector_Foot() choice4 = int(float(self.taskdevicepluginconfig[3])) # store linewrap state options = ["Auto","None"] optionvalues = [1,0] webserver.addFormSelector("Linebreak","p012_break",len(optionvalues),options,optionvalues,None,choice4) choice5 = int(float(self.taskdevicepluginconfig[4])) # store backlight state options = ["Enabled","Disabled"] optionvalues = [1,0] webserver.addFormSelector("Backlight","p012_blight",len(optionvalues),options,optionvalues,None,choice5) if "x2" in str(self.taskdevicepluginconfig[2]): lc = 2 else: lc = 4 for l in range(lc): try: linestr = self.lines[l] except: linestr = "" webserver.addFormTextBox("Line"+str(l+1),"p012_template"+str(l),linestr,128) webserver.addFormPinSelect("Display button","taskdevicepin0",self.taskdevicepin[0]) return True
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
def webform_load(self): # create html page for settings bledevs = BLEHelper.find_hci_devices() options = [] optionvalues = [] if bledevs: for bd in bledevs: options.append(bd) try: optionvalues.append(int(bd[3:])) except: optionvalues.append(bd[3:]) webserver.addFormSelector("Local Device","plugin_512_dev",len(options),options,optionvalues,None,int(self.taskdevicepluginconfig[2])) webserver.addFormTextBox("Device Address","plugin_512_addr",str(self.taskdevicepluginconfig[0]),20) webserver.addFormNote("Enable blueetooth then <a href='blescanner'>scan MJ_HT_ address</a> first.") webserver.addFormCheckBox("Add Battery value for non-Domoticz system","plugin_512_bat",self.taskdevicepluginconfig[1]) return True
def webform_load(self): # create html page for settings choice1 = str(self.taskdevicepluginconfig[0]) # store display type import luma.oled.device options = luma.oled.device.__all__ webserver.addHtml("<tr><td>Display type:<td>") webserver.addSelector_Head("p023_type",True) for d in range(len(options)): webserver.addSelector_Item(options[d],options[d],(choice1==options[d]),False) webserver.addSelector_Foot() choice2 = int(float(self.taskdevicepluginconfig[1])) # store i2c address options = ["0x3c","0x3d"] optionvalues = [0x3c,0x3d] webserver.addFormSelector("Address","p023_adr",len(options),options,optionvalues,None,choice2) webserver.addFormNote("Enable <a href='pinout'>I2C bus</a> first, than <a href='i2cscanner'>search for the used address</a>!") choice3 = int(float(self.taskdevicepluginconfig[2])) # store rotation state options = ["Normal","Rotate by 90","Rotate by 180","Rotate by 270"] optionvalues = [0,1,2,3] 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("<tr><td>Resolution:<td>") 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("<tr><td>Number of lines:<td>") 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 > 0 and choice5<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
def webform_load(self): # create html page for settings webserver.addFormTextBox("Device Address", "plugin_513_addr", str(self.taskdevicepluginconfig[0]), 20) webserver.addFormNote( "Enable blueetooth then <a href='blescanner'>scan LYWSD02 address</a> first." ) webserver.addFormNote( "This plugin may not work well with ble scanner plugin.") webserver.addFormCheckBox("Add Battery value for non-Domoticz system", "plugin_513_bat", self.taskdevicepluginconfig[1]) webserver.addFormCheckBox("Set LYWSD time at startup", "plugin_513_t", self.taskdevicepluginconfig[2]) webserver.addFormNumericBox( "Force to release BLE queue if blocked for x seconds", "plugin_513_free", self.taskdevicepluginconfig[3], 5, 240) webserver.addUnit('s') return True
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( "<TR><TD>Body:<TD><textarea name='body' rows='5' cols='80' size=512 wrap='off'>" ) webserver.addHtml(str(self.body)) webserver.addHtml("</textarea>") return True
def webform_load(self): cmd1 = str(self.taskdevicepluginconfig[0]) if '"' in cmd1 or "'" in cmd1: cmd1 = urllib.parse.quote(cmd1) cmd2 = str(self.taskdevicepluginconfig[1]) if '"' in cmd2 or "'" in cmd2: cmd2 = urllib.parse.quote(cmd2) webserver.addFormTextBox("Command 0", "plugin_511_cmd0", cmd1, 512) webserver.addFormTextBox("Command 1", "plugin_511_cmd1", cmd2, 512) webserver.addFormNote( "Specify OS commands that has to be executed at the speficied state (0/1)" ) webserver.addFormCheckBox("Use threading to run in background", "plugin_511_th", self.taskdevicepluginconfig[2]) webserver.addFormCheckBox("Enable parsing command line before execute", "plugin_511_parse", self.taskdevicepluginconfig[3]) options2 = ["None"] optionvalues2 = ["_"] for t in range(0, len(Settings.Tasks)): if (Settings.Tasks[t] and (type(Settings.Tasks[t]) is not bool)) and (t != self.taskindex): for v in range(0, Settings.Tasks[t].valuecount): options2.append("T" + str(t + 1) + "-" + str(v + 1) + " / " + str(Settings.Tasks[t].taskname) + "-" + str(Settings.Tasks[t].valuenames[v])) optionvalues2.append(str(t) + "_" + str(v)) webserver.addHtml("<tr><td>Trigger variable:<td>") webserver.addSelector_Head("p511_trigger", False) ddata = str(self.taskdevicepluginconfig[4]) for o in range(len(options2)): webserver.addSelector_Item(options2[o], optionvalues2[o], (str(optionvalues2[o]) == str(ddata)), False) webserver.addSelector_Foot() webserver.addFormNumericBox("Trigger Low value", "p511_low", self.taskdevicepluginconfig[5], -65535, 65535) webserver.addFormNumericBox("Trigger High value", "p511_high", self.taskdevicepluginconfig[6], -65535, 65535) return True
def webform_load(self): # create html page for settings bledevs = BLEHelper.find_hci_devices() options = [] optionvalues = [] if bledevs: for bd in bledevs: options.append(bd) try: optionvalues.append(int(bd[3:])) except: optionvalues.append(bd[3:]) webserver.addFormSelector("Local Device", "plugin_515_dev", len(options), options, optionvalues, None, int(self.taskdevicepluginconfig[5])) webserver.addFormTextBox("Device Address", "plugin_515_addr", str(self.taskdevicepluginconfig[0]), 20) webserver.addFormNote( "Enable blueetooth then <a href='blescanner'>scan 'Flower care' address</a> first." ) choice1 = self.taskdevicepluginconfig[1] choice2 = self.taskdevicepluginconfig[2] choice3 = self.taskdevicepluginconfig[3] choice4 = self.taskdevicepluginconfig[4] options = [ "None", "Temperature", "Brightness", "Moisture", "Conductivity", "Battery" ] optionvalues = [0, 1, 2, 3, 4, 5] webserver.addFormSelector("Indicator1", "plugin_515_ind0", len(options), options, optionvalues, None, choice1) webserver.addFormSelector("Indicator2", "plugin_515_ind1", len(options), options, optionvalues, None, choice2) webserver.addFormSelector("Indicator3", "plugin_515_ind2", len(options), options, optionvalues, None, choice3) webserver.addFormSelector("Indicator4", "plugin_515_ind3", len(options), options, optionvalues, None, choice4) return True
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
def webform_load(self): # create html page for settings bledevs = BLEHelper.find_hci_devices() options = [] optionvalues = [] if bledevs: for bd in bledevs: options.append(bd) try: optionvalues.append(int(bd[3:])) except: optionvalues.append(bd[3:]) webserver.addFormSelector("Local Device","plugin_510_dev",len(options),options,optionvalues,None,int(self.taskdevicepluginconfig[3])) 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.addFormNote("This plugin needs continous connection so WILL NOT WORK WITH scanner plugin on the same dongle!") webserver.addFormNumericBox("Reconnect time","plugin_510_reconnect",self.taskdevicepluginconfig[1],5,240) webserver.addUnit("s") options = ["Button+Connection","Button","Connection"] optionvalues = [0,1,2] webserver.addFormSelector("Return state of","plugin_510_ret",len(options),options,optionvalues,None,self.taskdevicepluginconfig[2]) return True
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
def webform_load(self): # create html page for settings webserver.addFormTextBox("RTSP stream", "plugin_522_url", str(self.taskdevicepluginconfig[0]), 255) webserver.addFormNote( "Specify the full URL to access stream, with password if needed") webserver.addFormCheckBox("Enable resize", "plugin_522_resize", self.taskdevicepluginconfig[1]) webserver.addFormNumericBox("Width to resize", "plugin_522_w", self.taskdevicepluginconfig[2], 0, 4096) webserver.addFormNumericBox("Height to resize", "plugin_522_h", self.taskdevicepluginconfig[3], 0, 2160) webserver.addFormNote( "Resize is a bit resource hungry, use only if really needed") webserver.addFormCheckBox("Force FFMPEG UDP", "plugin_522_udp", self.taskdevicepluginconfig[4]) webserver.addFormNote( "Certain cheap cameras only knows UDP, and OpenCV >3.0 defaults to TCP. OpenCV >4.0 accepts override." ) webserver.addFormNote( "In case the installed opencv is too old, upgrade manually: 'sudo apt remove python3-opencv && sudo pip3 install opencv-python'" ) try: if self.initialized and self.enabled: try: pname = self.gettaskname() except: pname = "" if pname == "": pname = "[NAME]" url = "image?name=" + str(pname) webserver.addHtml("<tr><td>Output image url:</td>") if pname == "[NAME]": webserver.addHtml("<td>http://ipaddress:port/image?name=" + pname) else: webserver.addHtml("<td><a href='" + url + "'>/" + url + "</a></td></tr>") except: pass return True