コード例 #1
0
ファイル: inp_udp.py プロジェクト: chrihuc/steuerzentrale
import threading
import socket
import time
import sys

hostName = socket.gethostbyname( constants.eigene_IP )

biSocket = socket.socket()# socket.AF_INET, socket.SOCK_STREAM )
biSocket.bind( (hostName, constants.udp_.biPORT) )
biSocket.listen(5)

PORT_NUMBER = constants.udp_.PORT
broadSocket = socket.socket( socket.AF_INET, socket.SOCK_DGRAM )
broadSocket.bind( (hostName, constants.udp_.broadPORT) )
scenes = szenen()
aes = alarm_event()

SIZE = 1024

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)
コード例 #2
0
from cmd_sonos import sonos
from cmd_xs1 import myezcontrol
from cmd_hue import hue_lights
from cmd_samsung import TV
from cmd_satellites import satelliten
from cmd_szenen import szenen

#from gui_inp import SzenenTreeInputs

xs1 = myezcontrol(constants.xs1_.IP)
hue = hue_lights()
sn = sonos()
tv = TV()
sat = satelliten()
szn = szenen()
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
szn_lst = sorted(szn.list_commands())

cmd_lsts = ['out_hue','out_Sonos']
cmd_lsts += sat.listCommandTable('alle',nameReturn = False)