plugins.nexa

Inheritance diagram of plugins.nexa

API

class plugins.nexa.Nexa(kernel)

Bases: models.Protocol

It is the main class of the Nexa protocol. It handles the incoming radio messages and transmits them to its connected devices. It follow the models.Protocol interface.

add_device(device_key, settings=None, switches=None)

Method used to add a device to the Nexa protocol. It takes the key of the device as argument, and optionally its initial settings and references to switches in the case of Nexa controllers.

process_message(message)

Processes a radio message received by the radio modem into a message understable by the protocol. The implementation of the message processing is a hard-coded finite-state machine.

send_command(device, command)

Method called when a device intends to send a message. It builds up the Nexa message according to the command to be sent and the identity of the sending device.

class plugins.nexa.NexaDevice(protocol, settings)

Bases: models.Device

This is the class used to implement any Nexa-controlled device.

switch_on(args)

(Internal) Method called when the “on” action is triggered. On the one side, it sends the radio command accordingly. On the other side, it updates the Information which reflects the state of the device.

switch_off(args)

(Internal) Method called when the “off” action is triggered. On the one side, it sends the radio command accordingly. On the other side, it updates the Information which reflects the state of the device.

sync(args)

(Internal) Method called when the “sync” action is triggered. It sends a series of “on” commands.

unsync(args)

(Internal) Method called when the “unsync” action is triggered. It sends a series of “off” commands.

class plugins.nexa.NexaDeviceModel(kernel)

Bases: models.DeviceModel

Class used as the base model for any Nexa-controlled device.

class plugins.nexa.NexaBaseSwitch(protocol, settings)

Bases: models.Device

It is the class used to represent the simplest two-button on/off switch. Then, remotes are in fact a compound of NexaBaseSwitches.

update(unit_code, new_command)

Method called to update the state of the device. It updates the linked Information accordingly.

class plugins.nexa.NexaController(protocol, switches, *args, **kwargs)

Bases: models.Device

The NexaController is the base class for any Nexa controller. In fact, it is the class used to gather several NexaBaseSwitches together.

It is useful so that Majordom actually mirrors the real devices: it would be confounding for a user to find the three buttons of the same remote scattered at different places in Majordom: this class is used to logically gather them.

plugins.nexa.protocol_class

alias of Nexa

plugins.nexa.random() → x in the interval [0, 1).

Table Of Contents

Previous topic

plugins.arduino_radio

Next topic

plugins.base_blocks

This Page