From 336eefb963b87d412a1777d36be9e04dd6f71b25 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan-Ole=20Hu=CC=88bner?= Date: Thu, 19 Dec 2024 01:48:58 +0100 Subject: [PATCH] acc cost filter --- DataPoints.py | 2 +- pulse.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) mode change 100644 => 100755 DataPoints.py diff --git a/DataPoints.py b/DataPoints.py old mode 100644 new mode 100755 index 2431c82..6ce07b6 --- a/DataPoints.py +++ b/DataPoints.py @@ -14,7 +14,7 @@ class Pulse: "power": float(power), "lastMeterConsumption": float(lastMeterConsumption) } - if cost is not None: + if cost is not None and float(cost) > 0: fields.update({'accumulatedCost':cost}) self.datapoint = {"fields": fields, "tags": tags, diff --git a/pulse.py b/pulse.py index 061945e..97c18f7 100755 --- a/pulse.py +++ b/pulse.py @@ -25,7 +25,7 @@ ch.setFormatter(formatter) logger.addHandler(ch) logger.setLevel(logging.INFO) -__version__ = "v0.4.2" +__version__ = "v0.4.3" logger.info(__version__) @@ -61,7 +61,7 @@ def stop(home): try: signal.signal(signal.SIGALRM, timeout_handler) signal.alarm(15) - home.start_live_feed(user_agent="pulse.py/0.4.2",exit_condition=stop(home),retries=4,retry_interval=5.0) + home.start_live_feed(user_agent="pulse.py/0.4.3",exit_condition=stop(home),retries=4,retry_interval=5.0) except TypeError: logger.exception("Timeout occurred while executing start_live_feed()") client.close()