7.2.1. mqttgateway.dummy package

7.2.1.1. Submodules

7.2.1.2. mqttgateway.dummy.dummy_start module

Launcher script for the dummy interface.

Use this as a template. If the name conventions have been respected, just change all occurrences of dummy into the name of your interface.

mqttgateway.dummy.dummy_start.main()

The entry point for the application

7.2.1.3. mqttgateway.dummy.dummy_interface module

The dummy interface class definition. Use it as a template.

This module defines the class dummyInterface that will be instantiated by the main module in the gateway package.

class mqttgateway.dummy.dummy_interface.dummyInterface(params, msglist_in, msglist_out)

Bases: object

Doesn’t do anything but provides a template.

The minimum requirement for the interface class is to define 2 public methods:

  • the constructor __init__,
  • the loop method.
Parameters:
  • params (dictionary of strings) – contains all the options from the configuration file This dictionary is initialised by the [INTERFACE] section in the configuration file. All the options in that section generate an entry in the dictionary. Use this to pass parameters from the configuration file to the interface, for example the name of a port, or the speed of a serial communication.
  • ( (msglist_out) – class:MsgList): list of incoming messages (internal representation)
  • ( – class:MsgList): list of outgoing messages (internal representation)
loop()

The method called periodically by the main loop.

Place here your code to interact with your system.

7.2.1.4. Module contents

A dummy gateway to test the installation setup, the loading of the configuration files, and the basic operation of the core application.