WlanSocket

class knut.services.light.wlansocket.WlanSocket(location: str, uid: str, room: str, cmd_on: str, cmd_off: str)

WLAN power socket as light service.

Extend the Light service to use a power socket which can be controlled via a web API.

Switch the socket on or off with the HTTP PUT commands cmd_on and cmd_off.

cmd_off = None

HTTP PUT command to switch the light off.

cmd_on = None

HTTP PUT command to switch the light on.

status_setter(status: dict)None

Extend the status setter to send either cmd_off or cmd_on depending in the 'state' key of the status dict.