RFLight

class knut.services.light.rflight.RFLight(location: str, uid: str, room: str, gpio: int, code_on: int, code_off: int)

A RF 433 mHz light service.

Provide a light service for lights plugged into a RF 433 mHz controllable power socket. This class uses the rpi-rf module to control a RF 433 mHz transmitter.

The transmitter at the defined gpio is used to send either a code_on or code_off command to switch the power socket.

status_setter(status: dict)

Send a code via the transmitter depending on the status.

Extend the base class method to send a code depending on the 'state' key of the status dict.