Publishes BOSWatch alarms as JSON payload via MQTT. More...
Public Member Functions | |
| __init__ (self, config) | |
| Do not change anything here! | |
| onLoad (self) | |
| Called by import of the plugin. | |
| setup (self) | |
| Called before alarm - recreates the sender if needed (self-healing) | |
| fms (self, bwPacket) | |
| Called on FMS alarm. | |
| pocsag (self, bwPacket) | |
| Called on POCSAG alarm. | |
| zvei (self, bwPacket) | |
| Called on ZVEI alarm. | |
| msg (self, bwPacket) | |
| Called on MSG packet. | |
| onUnload (self) | |
| Called by destruction of the plugin. | |
Public Member Functions inherited from plugin.pluginBase.PluginBase | |
| teardown (self) | |
| Called after alarm can be inherited. | |
| parseWildcards (self, msg) | |
| Return the message with parsed wildcards. | |
Data Fields | |
| brokerAddress | |
| brokerPort | |
| topicTemplate | |
| clientId | |
| username | |
| password | |
| qos | |
| retain | |
| keepalive | |
| statusTopic | |
| queueSize | |
| maxRetries | |
| initialDelay | |
| maxDelay | |
| sender | |
Data Fields inherited from plugin.pluginBase.PluginBase | |
| config | |
Protected Member Functions | |
| _ensure_sender (self) | |
| Ensures that a MqttSender instance exists - checking-with-hasattr pattern analogous to telegram.py's _ensure_sender() | |
| _publish (self, bwPacket) | |
| Serializes the complete bwPacket to JSON and enqueues it with the sender. | |
Protected Member Functions inherited from plugin.pluginBase.PluginBase | |
| _cleanup (self) | |
| Cleanup routine calls onUnload() directly. | |
| _run (self, bwPacket) | |
| start an complete running turn of an plugin. | |
| _getStatistics (self) | |
| Returns statistical information's from last plugin run. | |
Static Protected Member Functions | |
| _json_serializer (obj) | |
| Fail-safe JSON serializer for non-primitive data types. | |
| _packet_to_dict (bwPacket) | |
| Extracts the complete content of the bwPacket object as a dict. | |
Additional Inherited Members | |
Protected Attributes inherited from plugin.pluginBase.PluginBase | |
| _pluginName | |
| _bwPacket | |
| _sumTime | |
| _cumTime | |
| _setupTime | |
| _alarmTime | |
| _teardownTime | |
| _runCount | |
| _setupErrorCount | |
| _alarmErrorCount | |
| _teardownErrorCount | |
Static Protected Attributes inherited from plugin.pluginBase.PluginBase | |
| list | _pluginsActive = [] |
Publishes BOSWatch alarms as JSON payload via MQTT.
| plugin.mqtt.BoswatchPlugin.__init__ | ( | self, | |
| config | |||
| ) |
Do not change anything here!
Reimplemented from plugin.pluginBase.PluginBase.
| plugin.mqtt.BoswatchPlugin.onLoad | ( | self | ) |
Called by import of the plugin.
Reimplemented from plugin.pluginBase.PluginBase.
| plugin.mqtt.BoswatchPlugin.setup | ( | self | ) |
Called before alarm - recreates the sender if needed (self-healing)
Reimplemented from plugin.pluginBase.PluginBase.
| plugin.mqtt.BoswatchPlugin.fms | ( | self, | |
| bwPacket | |||
| ) |
Called on FMS alarm.
| bwPacket | bwPacket instance Remove if not implemented |
Reimplemented from plugin.pluginBase.PluginBase.
| plugin.mqtt.BoswatchPlugin.pocsag | ( | self, | |
| bwPacket | |||
| ) |
Called on POCSAG alarm.
| bwPacket | bwPacket instance Remove if not implemented |
Reimplemented from plugin.pluginBase.PluginBase.
| plugin.mqtt.BoswatchPlugin.zvei | ( | self, | |
| bwPacket | |||
| ) |
Called on ZVEI alarm.
| bwPacket | bwPacket instance Remove if not implemented |
Reimplemented from plugin.pluginBase.PluginBase.
| plugin.mqtt.BoswatchPlugin.msg | ( | self, | |
| bwPacket | |||
| ) |
Called on MSG packet.
| bwPacket | bwPacket instance Remove if not implemented |
Reimplemented from plugin.pluginBase.PluginBase.
| plugin.mqtt.BoswatchPlugin.onUnload | ( | self | ) |
Called by destruction of the plugin.
Reimplemented from plugin.pluginBase.PluginBase.
|
protected |
Ensures that a MqttSender instance exists - checking-with-hasattr pattern analogous to telegram.py's _ensure_sender()
|
protected |
Serializes the complete bwPacket to JSON and enqueues it with the sender.
| bwPacket | bwPacket instance |
|
staticprotected |
Fail-safe JSON serializer for non-primitive data types.
Packet.set() currently only ever stores strings, but this fallback defensively covers the case that a future module (e.g. a custom extension) writes an exotic object into a field - so a single unexpected data type cannot crash the whole plugin.
| obj | the object to serialize |
|
staticprotected |
Extracts the complete content of the bwPacket object as a dict.
Analogous to the approach in module/packetDump.py: instead of picking individual fields, the entire internal state of the packet is taken over, so fields added by other modules (Descriptor, Multicast, Geocoding, ...) automatically end up in the MQTT payload.
| bwPacket | bwPacket instance |
| plugin.mqtt.BoswatchPlugin.brokerAddress |
| plugin.mqtt.BoswatchPlugin.brokerPort |
| plugin.mqtt.BoswatchPlugin.topicTemplate |
| plugin.mqtt.BoswatchPlugin.clientId |
| plugin.mqtt.BoswatchPlugin.username |
| plugin.mqtt.BoswatchPlugin.password |
| plugin.mqtt.BoswatchPlugin.qos |
| plugin.mqtt.BoswatchPlugin.retain |
| plugin.mqtt.BoswatchPlugin.keepalive |
| plugin.mqtt.BoswatchPlugin.statusTopic |
| plugin.mqtt.BoswatchPlugin.queueSize |
| plugin.mqtt.BoswatchPlugin.maxRetries |
| plugin.mqtt.BoswatchPlugin.initialDelay |
| plugin.mqtt.BoswatchPlugin.maxDelay |
| plugin.mqtt.BoswatchPlugin.sender |