Skip to content

Commit

Permalink
Merge pull request #450 from Schrolli91/release_2_5_1
Browse files Browse the repository at this point in the history
Release 2 5 1
  • Loading branch information
Bastian Schroll authored Apr 28, 2020
2 parents 6054a38 + d9176db commit b4bb32a
Show file tree
Hide file tree
Showing 10 changed files with 43 additions and 6 deletions.
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
# Changelog

### __[v2.5.1]__ - 28.04.2020
##### Added
- Plugin requirements: Added requirements.txt for all plugins requiring extra python packages so the install will be easier [#446](https://github.com/Schrolli91/BOSWatch/pull/446)
- DescriptionList POC: add new description parameter for Sub-RICs without a main RIC definition. parameter 'onlysubric'. [#449](https://github.com/Schrolli91/BOSWatch/pull/449)
##### Fixed
- MySQL plugin: Ensure character set (utf8mb4) and collation (utf8mb4_general_ci) are set correctly when connection to database is established. [#447](https://github.com/Schrolli91/BOSWatch/pull/447)
- E-Mail plugin: Create MIME-compliant header that can contain any kind of string. [#448](https://github.com/Schrolli91/BOSWatch/pull/448)


### __[v2.5]__ - 16.04.2020
##### Added
- Divera-Plugin: Plugin zum Ansteuern der Divera-Api. [#415](https://github.com/Schrolli91/BOSWatch/pull/415)
Expand Down
5 changes: 5 additions & 0 deletions config/config.template.ini
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,11 @@ filter_range_end = 9999999
# descriptions are loaded from csv/poc.csv
idDescribed = 0

# change between Main-RIC with Sub-RIC (0 - off)
# or only the Sub-RIC (1 - on)
# descriptions are loaded from csv/poc.csv
onlysubric = 0

# Static Massages for Subrics.
rica = Feuer
ricb = TH
Expand Down
6 changes: 6 additions & 0 deletions csv/poc.template.csv
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,18 @@ ric,description
# For each RIC-Address you could set a description-text
# Use the structure: ric,"Description-Text"
#
# main RIC with subric:
# You can even define specific subrics, therefore you
# 1. need to specify a main RIC: 1234567, "Unit One"
# 2. specify a certain subric: 1234567B, "Subunit Bravo"
# The result for 1234567B will be "Unit One Subunit Bravo"
# - Be sure having defined the main RIC (step one)! -
#
# Only subric:
# Specify only the subric: 123457B, "Subunit Bravo"
# The result for 1234567B will be "Subunit Bravo"
# - main RIC is not required -
#
# !!! DO NOT delete the first line !!!
#
1234567,"POCSAG testdata äöüß"
7 changes: 5 additions & 2 deletions includes/descriptionList.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,11 @@ def getDescription(typ, data):
elif typ == "ZVEI":
resultStr = zveiDescribtionList[data]
elif typ == "POC":
resultStr = ricDescribtionList[data[:-1]] # MainRIC
resultStr += " " + ricDescribtionList[data] # SubRIC
if globalVars.config.getint("POC", "onlysubric"):
resultStr = ricDescribtionList[data] # only SubRIC
else:
resultStr = ricDescribtionList[data[:-1]] # MainRIC
resultStr += " " + ricDescribtionList[data] # SubRIC
else:
logging.warning("Invalid Typ: %s", typ)

Expand Down
4 changes: 2 additions & 2 deletions includes/globalVars.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@
"""

# version info
versionNr = "2.5"
versionNr = "2.5.1"
branch = "master"
buildDate = "16.04.2020"
buildDate = "28.04.2020"

# Global variables
config = 0
Expand Down
2 changes: 1 addition & 1 deletion plugins/MySQL/MySQL.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ def run(typ,freq,data):
# Connect to MySQL
#
logging.debug("connect to MySQL")
connection = mysql.connector.connect(host = globalVars.config.get("MySQL","dbserver"), port = globalVars.config.get("MySQL","dbport"), user = globalVars.config.get("MySQL","dbuser"), passwd = globalVars.config.get("MySQL","dbpassword"), db = globalVars.config.get("MySQL","database"), charset='utf8mb4')
connection = mysql.connector.connect(host = globalVars.config.get("MySQL","dbserver"), port = globalVars.config.get("MySQL","dbport"), user = globalVars.config.get("MySQL","dbuser"), passwd = globalVars.config.get("MySQL","dbpassword"), db = globalVars.config.get("MySQL","database"), charset = 'utf8mb4', collation = 'utf8mb4_general_ci')
cursor = connection.cursor()
except:
logging.error("cannot connect to MySQL")
Expand Down
10 changes: 10 additions & 0 deletions plugins/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,16 @@ This `.run()` routine is called every time an alarm comes in

Here are the information from BOSWatch available. See section `5. Process the data from BOSWatch`

#### 1.4 Requirements
Add all required (which need to be installed separately) python packages to a requirements.txt in the plugin directory so that the user can simply install all requirements for this plugin.

For examples look at [the Telegram plugin](Telegram/requirements.txt)

##### 1.4.1 Requirement installation
To install the packages from the requirements.txt run
`pip install -r /path/to/plugin/directory/requirements.txt`
Or because for the current version (2.5) Python2 is required
`pip2 install -r /path/to/plungin/directory/requirements.txt` will work for sure

## 2. Use Global Logging
#### 2.1 Init and Use
Expand Down
2 changes: 2 additions & 0 deletions plugins/Telegram/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
python-telegram-bot
requests
3 changes: 2 additions & 1 deletion plugins/eMail/eMail.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@

import smtplib #for the SMTP client
from email.mime.text import MIMEText # Import the email modules we'll need
from email.header import Header # Import the email modules we'll need
from email.utils import formatdate # need for confirm to RFC2822 standard
from email.utils import make_msgid # need for confirm to RFC2822 standard

Expand Down Expand Up @@ -61,7 +62,7 @@ def doSendmail(server, subject, mailtext):
msg = MIMEText(mailtext, 'plain', 'UTF-8')
msg['From'] = globalVars.config.get("eMail", "from")
msg['To'] = globalVars.config.get("eMail", "to")
msg['Subject'] = subject
msg['Subject'] = Header(subject, 'UTF-8')
msg['Date'] = formatdate()
msg['Message-Id'] = make_msgid()
msg['Priority'] = globalVars.config.get("eMail", "priority")
Expand Down
1 change: 1 addition & 0 deletions plugins/yowsup/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
yowsup2

0 comments on commit b4bb32a

Please sign in to comment.