import sockethost = '192.168.100.100'port = 20400 # The same port as used by the servers = socket.socket(socket.AF_INET, socket.SOCK_STREAM)s.connect((host, port))s.sendall(b'{"command":1,"data":{"login":"*****","password":"*****"}}')data = s.recv(1024)print('Received', repr(data))s.sendall(b'{"command":61,"data": {"id": 1}}')data = s.recv(1024)print('Received', repr(data))
('Received', '\'{"command":61,"status":"success","data":{"id":1,"func_type":5,"state":{"type":2,"alias":"Moj_alias_123","running":true},"conf":{"scene":{"id":4,"func_type":4,"type":1,"alias":"Moja_scena_123","state":{"elements":5,"running":false}},"time":"19:50","days":[0,1,2,3,4,5,6]}}}\\x03\'')
s.sendall(b'{"command":62,"data":{"id":1,"func_type":5,"conf":{"time":"21:00","days":[0,1,2,3,4,5,6]}}}')data = s.recv(1024)print('Received', repr(data))
s.sendall(b'{"command":62,"data":{"id":1,"type":2,"conf":{"scene_id":4,"time":"21:00","days":[0,1,2,3,4,5,6]}}}')data = s.recv(1024)print('Received', repr(data))
Ok chyba udało się:Kod: [Zaznacz]s.sendall(b'{"command":62,"data":{"id":1,"type":2,"conf":{"scene_id":4,"time":"21:00","days":[0,1,2,3,4,5,6]}}}')data = s.recv(1024)print('Received', repr(data))Jak mogę edytować wiki?