aggiunto invio eventi, get status all' inizio
parent
e09fbc26a2
commit
63ff03d56f
|
|
@ -40,6 +40,16 @@ def send_response(queue_out, ip, command, data):
|
||||||
print(f"Mando Risposta: {msg}")
|
print(f"Mando Risposta: {msg}")
|
||||||
queue_out.put(msg)
|
queue_out.put(msg)
|
||||||
|
|
||||||
|
def send_event(queue_out, ip, connected, error, warning):
|
||||||
|
msg = {
|
||||||
|
'ip': ip,
|
||||||
|
'connected': connected,
|
||||||
|
'error' : error,
|
||||||
|
'warning': warning
|
||||||
|
}
|
||||||
|
print(f"Mando Evento: {msg}")
|
||||||
|
queue_out.put(msg)
|
||||||
|
|
||||||
def send_hello(queue_out):
|
def send_hello(queue_out):
|
||||||
queue_out.put({
|
queue_out.put({
|
||||||
'url': URL_HELLO,
|
'url': URL_HELLO,
|
||||||
|
|
|
||||||
|
|
@ -102,6 +102,7 @@ def tsc_printer(q_in: queue.Queue, q_out: queue.Queue, q_cmd: queue.Queue, ip: s
|
||||||
try:
|
try:
|
||||||
with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as prt:
|
with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as prt:
|
||||||
prt.connect((ip, port))
|
prt.connect((ip, port))
|
||||||
|
get_status()
|
||||||
while True:
|
while True:
|
||||||
itm = q_in.get(block=True)
|
itm = q_in.get(block=True)
|
||||||
cmd = itm['name']
|
cmd = itm['name']
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue