From e6eca778e4e6d732c78c445e9d5012cf3c6616d3 Mon Sep 17 00:00:00 2001 From: Sven Augustin Date: Sat, 10 Dec 2022 23:03:21 +0100 Subject: [PATCH] renamed get_current_value -> get_last_value; added stub for get_current_value; get is an alias for get_aggregate --- slic/core/sensor/sensor.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/slic/core/sensor/sensor.py b/slic/core/sensor/sensor.py index 3291f057..38fbe104 100644 --- a/slic/core/sensor/sensor.py +++ b/slic/core/sensor/sensor.py @@ -11,9 +11,11 @@ class Sensor(BaseSensor): self.aggregation = aggregation self._cache = [] - - #TODO: should this be get_LAST_value? + #TODO: is this mandatory? def get_current_value(self): + raise NotImplementedError + + def get_last_value(self): try: return self._cache[-1] except IndexError: @@ -25,7 +27,7 @@ class Sensor(BaseSensor): except Exception: return None - get = get_aggregate #TODO: should get return the aggregation result or the current value!? + get = get_aggregate def _collect(self, value):