mirror of
https://github.com/Schrolli91/BOSWatch.git
synced 2026-01-20 15:20:16 +01:00
commit
b4bb32a41b
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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 äöüß"
|
||||
|
|
|
|||
|
Can't render this file because it has a wrong number of fields in line 2.
|
|
|
@ -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)
|
||||
|
||||
|
|
|
|||
|
|
@ -9,9 +9,9 @@ Global variables
|
|||
"""
|
||||
|
||||
# version info
|
||||
versionNr = "2.5"
|
||||
versionNr = "2.5.1"
|
||||
branch = "master"
|
||||
buildDate = "16.04.2020"
|
||||
buildDate = "28.04.2020"
|
||||
|
||||
# Global variables
|
||||
config = 0
|
||||
|
|
|
|||
|
|
@ -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")
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
2
plugins/Telegram/requirements.txt
Normal file
2
plugins/Telegram/requirements.txt
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
python-telegram-bot
|
||||
requests
|
||||
|
|
@ -13,6 +13,7 @@ import logging # Global logger
|
|||
|
||||
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
|
||||
|
||||
|
|
@ -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")
|
||||
|
|
|
|||
1
plugins/yowsup/requirements.txt
Normal file
1
plugins/yowsup/requirements.txt
Normal file
|
|
@ -0,0 +1 @@
|
|||
yowsup2
|
||||
Loading…
Reference in a new issue