diff --git a/core/statsmanager.py b/core/statsmanager.py index c8df09a..38d2e68 100644 --- a/core/statsmanager.py +++ b/core/statsmanager.py @@ -106,9 +106,13 @@ def update_percent_status_data(cls, group, key, new_value): cls.insert_new_status_data(group, key, new_value) cls.data[group][date_key] = today - value = cls.data[group][key] - value = (value + new_value) / 2 - cls.data[group][key] = value + if key in cls.data[group]: + value = cls.data[group][key] + value = (value + new_value) / 2 + cls.data[group][key] = value + else: + value = new_value + cls.data[group][key] = value cls.save_data() return value diff --git a/core/version.py b/core/version.py index a33b48e..5b7d096 100644 --- a/core/version.py +++ b/core/version.py @@ -25,4 +25,4 @@ # Project: [SEUSS -> Smart Ess Unit Spotmarket Switcher # -__version__ = "0.0.174" +__version__ = "0.0.178"