miio.push_server.serverprotocol module

class miio.push_server.serverprotocol.ServerProtocol(loop, udp_socket, server)[source]

Bases: object

Handle responding to UDP packets.

close()[source]

Stop the server.

connection_lost(exc)[source]

Handle connection lost.

connection_made(transport)[source]

Set the transport.

datagram_received(data, addr)[source]

Handle received messages.

error_received(exc)[source]

Log UDP errors.

send_error(host, port, msg_id, token, code, message)[source]

Send error message with given code and message to the client.

send_ping_ACK(host, port)[source]
send_response(host, port, msg_id, token, payload=None)[source]