示例#1
0
 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
示例#2
0
 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
示例#3
0
 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
示例#4
0
 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
示例#5
0
 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
示例#6
0
 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