-
-
Notifications
You must be signed in to change notification settings - Fork 24
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
implemented multicast alarms #88
base: develop
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Only a quick look. At the moment i have no time for a detailed deep review.
But i will do it as soon as possible.
module/multicast.py
Outdated
logging.debug("starting multicast module") | ||
logging.debug("multicastAlarm_delimiterRic is: %i" % self.config.get("multicastAlarm_delimiterRic")) | ||
logging.debug("multicastAlarm_delimiterSubric is: %i" % self.config.get("multicastAlarm_delimiterSubric")) | ||
logging.debug("multicastAlarm_ignore_time is: %i" % self.config.get("multicastAlarm_ignore_time")) | ||
logging.debug("multicastAlarm_textRics is: %s" % self.config.get("multicastAlarm_textRics")) | ||
self.delimiterRic = int(self.config.get("multicastAlarm_delimiterRic")) | ||
self.delimiterSubric = int(self.config.get("multicastAlarm_delimiterSubric")) | ||
self.ignoreTime = int(self.config.get("multicastAlarm_ignore_time")) | ||
for aTextRic in self.config.get("multicastAlarm_textRics").split(','): | ||
self.textRics.append(int(aTextRic)) | ||
self.initStorage() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be done in the onLoad()
method below.
The Init must not be changed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see. I will change that accordingly.
module/multicast.py
Outdated
pass | ||
else: | ||
logging.error("multicast module only works with pocsag") | ||
raise NameError('multicast module only works with pocsag') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please respect the defined return values for the modules.
See "Rückgabewert bei Modulen".
https://docs.boswatch.de/develop/ModulPlugin.html#arbeiten-mit-dem-bwpacket
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A module should return either of these: bwPacket, False, None
According to the manual, "False" simply stops the Router. In the above situation, everything should stop because the user demands something impossible? Is raising an error a problem for the rest of the logic?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm currently not sure where this exception will be caught, but I think it will kill the entire server application.
The idea behind this router concept is that you can also have multiple types of messages in a single pipeline.
So it is possible that I want to send ZVEI and POCSAG via a single pipeline (e.g. send by Telegram), but only the POCSAG files should be modified by this module.
For me this is not a error as nothing will break if you return False
I implemented a first sketch of a new module processing multicast alarms.