diff --git a/plugin/telegram.py b/plugin/telegram.py index 80ff9e7..5dea41f 100644 --- a/plugin/telegram.py +++ b/plugin/telegram.py @@ -45,13 +45,13 @@ class BoswatchPlugin(PluginBase): if bwPacket.get("lat") is not None and bwPacket.get("lon") is not None: logging.debug("Found coordinates in packet") (lat, lon) = (bwPacket.get("lat"), bwPacket.get("lon")) - + for chatId in self.config.get("chatIds", default=[]): try: # Send Message via Telegram logging.info("Sending message to " + chatId) self.bot.send_message(chat_id=chatId, text=msg) - + # Send Location via Telegram if lat and lon are defined if lat is not None and lon is not None: logging.info("Sending location to " + chatId) diff --git a/pytest.sh b/pytest.sh new file mode 100644 index 0000000..2a06d75 --- /dev/null +++ b/pytest.sh @@ -0,0 +1,3 @@ +source ./venv/bin/activate +pytest -c test/pytest.ini +deactivate \ No newline at end of file