add msg mode to plugin

This commit is contained in:
Bastian Schroll 2018-02-22 08:28:02 +01:00
parent b1cc765607
commit 48ecdd666c
2 changed files with 15 additions and 1 deletions

View file

@ -92,6 +92,9 @@ class Plugin:
if bwPacket.get("mode") is "zvei":
logging.debug("[%s] zvei()", self._pluginName)
self.zvei(bwPacket)
if bwPacket.get("mode") is "msg":
logging.debug("[%s] msg()", self._pluginName)
self.msg(bwPacket)
except:
self._alarmErrorCount += 1
logging.exception("[%s] alarm error", self._pluginName)
@ -161,6 +164,13 @@ class Plugin:
@param bwPacket: bwPacket instance"""
logging.warning("ZVEI not implemented in %s", self._pluginName)
def msg(self, bwPacket):
"""!Called on MSG packet
Must be inherit
@param bwPacket: bwPacket instance"""
logging.warning("MSG not implemented in %s", self._pluginName)
def teardown(self):
"""!Called after alarm
Must be inherit"""

View file

@ -51,7 +51,11 @@ class BoswatchPlugin(Plugin):
"""!Called on ZVEI alarm
@param bwPacket: bwPacket instance"""
pass
def msg(self, bwPacket):
"""!Called on MSG packet
@param bwPacket: bwPacket instance"""
def teardown(self):
"""!Called after alarm"""