phenome.extensions.lib.tplink.device module

class TPLinkSmartDevice(host, port=9999, timeout=3, connect=False)

Bases: object

An object to represent any TP-Link smart device.

You may not have to instantiate that object directly.

DEFAULT_PORT = 9999
close()

Close the connection to the smart device.

connect()

Establish a connection to the smart device.

property host

Return the smart device host.

property port

Return the smart device port.

recv()

Wait for data coming from the smart device.

send(command)

Send a command to the smart device.

Parameters

commanddict or string containing the command to send.

property socket

Return the socket used to connect to the device.

Use this property with caution.