From 31a6e13f0e8f5eabd9adb5187cc35119d88b5c1c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yann=20B=C3=BCchau?= Date: Thu, 9 Mar 2017 09:50:10 +0100 Subject: [PATCH] release v0.0.13 - add configurable sleep interval between readings --- debian/changelog | 6 ++++++ etc/co2monitor/service.conf | 4 ++++ usr/lib/co2monitor/python/co2monitor/service.py | 9 +++++++++ usr/share/co2monitor/lang/de/LC_MESSAGES/co2monitor.po | 8 ++++---- usr/share/co2monitor/lang/fr/LC_MESSAGES/co2monitor.po | 8 ++++---- 5 files changed, 27 insertions(+), 8 deletions(-) diff --git a/debian/changelog b/debian/changelog index 3331aab..b4035de 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +co2monitor (0.0.13) unstable; urgency=medium + + * add configurable sleep interval between readings + + -- Yann Büchau Thu, 09 Mar 2017 09:46:59 +0100 + co2monitor (0.0.12) unstable; urgency=medium * .desktop-file starts plot.R, not the unfinished gui diff --git a/etc/co2monitor/service.conf b/etc/co2monitor/service.conf index 254dd17..864afc7 100644 --- a/etc/co2monitor/service.conf +++ b/etc/co2monitor/service.conf @@ -14,3 +14,7 @@ datafolder = /var/lib/co2monitor/data # warmup time in seconds # (first measurements after device start are often bogus) warmuptime = 30 +# idle interval between readings in seconds +# the devices yield data around every 10 seconds. +# Values below 10 here don't increase the frequency! +interval = 0 diff --git a/usr/lib/co2monitor/python/co2monitor/service.py b/usr/lib/co2monitor/python/co2monitor/service.py index aad4ed9..f920e51 100644 --- a/usr/lib/co2monitor/python/co2monitor/service.py +++ b/usr/lib/co2monitor/python/co2monitor/service.py @@ -318,6 +318,15 @@ def run(self): measold.update(meas) else: # measurement didn't work break # exit logloop + + # wait predefined number of seconds + try: + waittime = int( + self.config["data-logging"].getint("interval")) + assert waittime > 0 + except: + waittime = 0 + time.sleep(waittime) # logging ended self.logger.info(_("stopped logging.")) diff --git a/usr/share/co2monitor/lang/de/LC_MESSAGES/co2monitor.po b/usr/share/co2monitor/lang/de/LC_MESSAGES/co2monitor.po index da2268f..b1e6ef0 100644 --- a/usr/share/co2monitor/lang/de/LC_MESSAGES/co2monitor.po +++ b/usr/share/co2monitor/lang/de/LC_MESSAGES/co2monitor.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2017-03-08 20:00+0100\n" +"POT-Creation-Date: 2017-03-09 09:44+0100\n" "PO-Revision-Date: 2016-11-28 14:04+0100\n" "Last-Translator: \n" "Language-Team: \n" @@ -197,15 +197,15 @@ msgstr "Nachbearbeitung der Rohdaten" msgid "writing data to file" msgstr "schreibe Daten in Aufzeichnungsdatei" -#: usr/lib/co2monitor/python/co2monitor/service.py:323 +#: usr/lib/co2monitor/python/co2monitor/service.py:332 msgid "stopped logging." msgstr "Datenaufzeichnung beendet." -#: usr/lib/co2monitor/python/co2monitor/service.py:324 +#: usr/lib/co2monitor/python/co2monitor/service.py:333 msgid "closed data logging file '{}'" msgstr "Datenaufzeichnungsdatei '{}' geschlossen" -#: usr/lib/co2monitor/python/co2monitor/service.py:326 +#: usr/lib/co2monitor/python/co2monitor/service.py:335 msgid "Stopped data logging on device {}" msgstr "beende Datenaufzeichnung auf Gerät {}" diff --git a/usr/share/co2monitor/lang/fr/LC_MESSAGES/co2monitor.po b/usr/share/co2monitor/lang/fr/LC_MESSAGES/co2monitor.po index b028256..af93e82 100644 --- a/usr/share/co2monitor/lang/fr/LC_MESSAGES/co2monitor.po +++ b/usr/share/co2monitor/lang/fr/LC_MESSAGES/co2monitor.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2017-03-08 20:00+0100\n" +"POT-Creation-Date: 2017-03-09 09:44+0100\n" "PO-Revision-Date: 2016-11-28 14:02+0100\n" "Last-Translator: \n" "Language-Team: \n" @@ -195,15 +195,15 @@ msgstr "travail postérieur des données crus" msgid "writing data to file" msgstr "écrire les données au fichier" -#: usr/lib/co2monitor/python/co2monitor/service.py:323 +#: usr/lib/co2monitor/python/co2monitor/service.py:332 msgid "stopped logging." msgstr "enregistrement arrêté." -#: usr/lib/co2monitor/python/co2monitor/service.py:324 +#: usr/lib/co2monitor/python/co2monitor/service.py:333 msgid "closed data logging file '{}'" msgstr "fichier d'enregistrement '{}' fermé" -#: usr/lib/co2monitor/python/co2monitor/service.py:326 +#: usr/lib/co2monitor/python/co2monitor/service.py:335 msgid "Stopped data logging on device {}" msgstr "arrêté enregistrement d'appareil {}"