Пример #1
0
 def listCommandTable(self,device='alle', nameReturn = True):
     liste = [] 
     list_cmds_of = []
     if device == 'alle':
         list_cmds_of = self.list_devices()
     elif device=="forSave":
         list_cmds_of = mdb_read_table_column(table.name,"Name")            
     else:
         list_cmds_of.append(device)
     for sates in list_cmds_of:
         cmds_table=mdb_read_table_entry(table.name,sates)
         if self.__check_table_exists__(cmds_table.get('command_set')):           
             if nameReturn:
                 liste.append(cmds_table.get('Name'))
             else:
                 liste.append(cmds_table.get('command_set'))
     return liste
Пример #2
0
def exec_data(data_ev):
    if ('Name' in data_ev) and ('Value' in data_ev):
        name = data_ev.get('Name')
        value = data_ev.get('Value')
        #print name, value
        szns = inputs(name,value)
        for szene in szns:
            if szene <> None:
                scenes.threadExecute(szene, check_bedingung=False, wert = value)  
#    elif data_ev.get('Command')=='Update':
#        aes.new_event(description="System update", prio=0)
#        cmd_internal.git_update() 
    elif ('Szene' in data_ev):   
        name = data_ev.get('Szene') 
        if name in mdb_read_table_column(constants.sql_tables.szenen.name, 'Name'):
            scenes.threadExecute(name) 
    elif ('GCM-Client' in data_ev):
        aes.new_event('GCM Client: ' + data_ev.get('GCM-Client'))                
Пример #3
0
 def dict_commands(self,device='alle'):
     liste = {'':1,'man':2,'auto':3}
     itera = 3
     list_cmds_of = []
     if device == 'alle':
         list_cmds_of = self.list_devices()
     else:
         list_cmds_of.append(device)
     for sates in list_cmds_of:
         cmds_table=mdb_read_table_entry(table.name,sates).get('command_set')
         if self.__check_table_exists__(cmds_table):           
             comands = mdb_get_table(cmds_table)
             for comand in comands:
                 itera +=1
                 liste[comand.get("Name")] = itera 
         elif cmds_table == 'server':
             comands = mdb_read_table_column(constants.sql_tables.szenen.name, 'Name')
             for comand in comands:
                 itera +=1
                 liste[comand] = itera                 
     return liste        
Пример #4
0
def update():
    global inp,t,t2,t3,t4,sz, sets,cmds,seTre, comboBox, comboBox2, comboBox3, szn_lst, xs1_devs, xs1_cmds, hue_devs, hue_cmds, sns_devs, sns_cmds, tvs_devs, tvs_cmds, sat_devs, sat_cmds, cmd_devs
    szn_lst = sorted(szn.list_commands())
    xs1_devs = xs1.list_devices()
    xs1_cmds = xs1.dict_commands()
    hue_devs = hue.list_devices()
    hue_cmds = hue.dict_commands()
    sns_devs = sn.list_devices()
    sns_cmds = sn.dict_commands()
    tvs_devs = tv.list_devices()
    tvs_cmds = tv.dict_commands()
    sat_devs = sat.list_devices()
    sat_cmds = sat.dict_commands()
    cmd_devs = xs1_devs + hue_devs + sns_devs + tvs_devs + sat_devs    
    sets = mdb_get_table(constants.sql_tables.settings.name)
    selected(lastSelected) 
    inp=InputsTree(isInputs = True, inputsGroup = str(comboBox5.currentText()))
    t2.setParameters(inp.p, showTop=False)
    cmds=InputsTree(isInputs = False, cmdTable = cmd_lsts[0])
    t3.setParameters(cmds.p, showTop=False) 
    seTre = SettingsTree()
    t4.setParameters(seTre.p, showTop=False)    
    comboBox.clear()
    for szne in szn_lst:
        comboBox.addItem(szne) 
    comboBox2.clear()
    for cmdLst in cmd_lsts:
        comboBox2.addItem(cmdLst)
    comboBox2.activated[str].connect(slctCmdLst)        
    comboBox3.clear()
    inpts = sorted(mdb_read_table_column(db="cmd_inputs", column = 'Description'))
    for inpt in inpts:
        if str(inpt) <> "":
            comboBox3.addItem(str(inpt))        
    inp.p.sigTreeStateChanged.connect(change)
    sz.p.sigTreeStateChanged.connect(change_sz)