Merge pull request #482 from PeterLaemmle/develop

HTML style formatting for Telegram plugin
This commit is contained in:
Bastian Schroll 2020-09-29 11:09:21 +02:00 committed by GitHub
commit fa039c0f03
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 9 additions and 5 deletions

View file

@ -7,6 +7,7 @@
##### Changed
- Divera Plugin: Add individual alarms for FMS, ZVEI and POC. [#451](https://github.com/Schrolli91/BOSWatch/pull/451)
- install.sh: local git repo available at /opt/boswatch (or at your own path). Updates easier with `git pull` in /opt/boswatch. [#452](https://github.com/Schrolli91/BOSWatch/pull/452)
- Telegram Plugin: Add support for simple HTML style message formatting. [#482](https://github.com/Schrolli91/BOSWatch/pull/482)
##### Deprecated
##### Removed
##### Fixed

View file

@ -426,14 +426,17 @@ GoogleAPIKey =
# Use the following format: CityOfOrigin+Street+Number
RoutingOrigin = MyCity+MyStreet+MyNumber
#Wildcards can be used, see end of the file!
# Wildcards can be used, see end of the file!
# In addition, feel free to use simple HTML stlye tags like <b>%FMS%</b>
FMS_message = %DATE% %TIME%: %FMS%
#Wildcards can be used, see end of the file!
#W ildcards can be used, see end of the file!
# In addition, feel free to use simple HTML stlye tags like <b>%ZVEI%</b>
ZVEI_message = %DATE% %TIME%: %ZVEI%
#Wildcards can be used, see end of the file!
POC_message = %MSG%
# Wildcards can be used, see end of the file!
# In addition, feel free to use simple HTML stlye tags like <b>%DESCR%</b>
POC_message = %DESCR%%BR%%MSG%
[yowsup]

View file

@ -94,7 +94,7 @@ def run(typ,freq,data):
bot = telegram.Bot(token='%s' % BOTTokenAPIKey)
# Send message to chat via Telegram BOT API
logging.debug("Send message to chat via Telegram BOT API")
bot.sendMessage('%s' % BOTChatIDAPIKey, text)
bot.sendMessage('%s' % BOTChatIDAPIKey, text, parse_mode=telegram.ParseMode.HTML)
# Generate location information only for specific RIC
if typ == "POC" and data["ric"] == RICforLocationAPIKey: