mqtt_gateways.dummy package¶
Module contents¶
A dummy gateway to test the installation setup, the loading of the configuration files, and the basic operation of the core application.
There are 2 modules:
dummy_interface.py
defines the classdummyInterface
;dummy2mqtt.py
which is the application launcher.
Submodules¶
mqtt_gateways.dummy.dummy2mqtt module¶
Launcher script for the dummy gateway.
Use this as a template.
If the name conventions have been respected, just change all occurrences of
dummy
into the name of your gateway.
mqtt_gateways.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 gateway module.
Any other code needed for the interface can be placed here or in other
modules, as long as the necessary imports are included of course.
-
class
mqtt_gateways.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__
which takes 4 arguments, - 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.-
loop
()¶ The method called periodically by the main loop.
Place here your code to interact with your system.
- the constructor