From 0e386e79c96a67fc46f12e2efc80060f9fb72f5f Mon Sep 17 00:00:00 2001 From: Lars Gremme Date: Sun, 23 Jan 2022 12:25:30 +0100 Subject: [PATCH] Changes request by review --- docu/docs/plugin/divera.md | 2 +- install.sh | 2 +- plugin/divera.py | 18 +++++++++--------- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/docu/docs/plugin/divera.md b/docu/docs/plugin/divera.md index 9e5fa02..a78c7cb 100644 --- a/docu/docs/plugin/divera.md +++ b/docu/docs/plugin/divera.md @@ -2,7 +2,7 @@ --- ## Beschreibung -Mit diesem Plugin ist es moeglich, Http-Anfragen für Alarmierungen an Divera 24/7 zu senden. +Mit diesem Plugin ist es möglich, HTTPS-Anfragen für Alarmierungen an Divera 24/7 zu senden. Wildcards in den Urls werden automatisch ersetzt. ## Unterstütze Alarmtypen diff --git a/install.sh b/install.sh index 6e2244c..839d018 100644 --- a/install.sh +++ b/install.sh @@ -113,7 +113,7 @@ tput cup 13 15 echo "[ 2/9] [##-------]" tput cup 15 5 echo "-> download GIT and other stuff.........." -apt-get -y install git cmake build-essential libusb-1.0 qt5-qmake libpulse-dev libx11-dev sox >> ${boswatch_install_path}/setup_log.txt 2>&1 +apt-get -y install git cmake build-essential libusb-1.0 qt5-qmake qt5-default libpulse-dev libx11-dev sox >> ${boswatch_install_path}/setup_log.txt 2>&1 exitcodefunction $? download stuff tput cup 13 15 diff --git a/plugin/divera.py b/plugin/divera.py index 55593c5..e6d4e25 100644 --- a/plugin/divera.py +++ b/plugin/divera.py @@ -50,7 +50,7 @@ class BoswatchPlugin(PluginBase): "priority": fms_data.get("priority", default="false"), }) apipath = "/api/fms" - self.makeRequests(apipath, apicall) + self._makeRequests(apipath, apicall) def pocsag(self, bwPacket): """!Called on POCSAG alarm @@ -66,7 +66,7 @@ class BoswatchPlugin(PluginBase): "priority": poc_data.get("priority", default="false"), }) apipath = "/api/alarm" - self.makeRequests(apipath, apicall) + self._makeRequests(apipath, apicall) def zvei(self, bwPacket): """!Called on ZVEI alarm @@ -82,7 +82,7 @@ class BoswatchPlugin(PluginBase): "priority": zvei_data.get("priority", default="false"), }) apipath = "/api/alarm" - self.makeRequests(apipath, apicall) + self._makeRequests(apipath, apicall) def msg(self, bwPacket): """!Called on MSG packet @@ -98,9 +98,9 @@ class BoswatchPlugin(PluginBase): "priority": msg_data.get("priority", default="false"), }) apipath = "/api/alarm" - self.makeRequests(apipath, apicall) + self._makeRequests(apipath, apicall) - def makeRequests(self, apipath, apicall): + def _makeRequests(self, apipath, apicall): """Parses wildcard urls and handles asynchronus requests @param urls: array of urls""" @@ -109,10 +109,10 @@ class BoswatchPlugin(PluginBase): loop = asyncio.get_event_loop() - future = asyncio.ensure_future(self.asyncRequests(request)) + future = asyncio.ensure_future(self._asyncRequests(request)) loop.run_until_complete(future) - async def asyncRequests(self, url): + async def _asyncRequests(self, url): """Handles asynchronus requests @param urls: array of urls to send requests to""" @@ -120,13 +120,13 @@ class BoswatchPlugin(PluginBase): async with ClientSession() as session: logging.debug("Generated URL: [{}]".format(url)) - task = asyncio.ensure_future(self.fetch(url, session)) + task = asyncio.ensure_future(self._fetch(url, session)) tasks.append(task) responses = asyncio.gather(*tasks) await responses - async def fetch(self, url, session): + async def _fetch(self, url, session): """Fetches requests @param url: url