diff --git a/app/myenedis.py b/app/myenedis.py index e9682375..1d3bf226 100644 --- a/app/myenedis.py +++ b/app/myenedis.py @@ -284,7 +284,8 @@ def forceRound(x, n): attributes[f'day_{day}_{measure_type}'] = -1 attributes[f'dailyweek_cost{measure_type}'].append(-1) attributes[f'dailyweek_{measure_type}'].append(-1) - attributes["dailyweek_cost"][day-1] = -1 + attributes["dailyweek_cost"][day-1] = -1 + pprint("dailyweek_cost") else: value_wh_total = 0 dailyweek_cost = 0 @@ -302,10 +303,12 @@ def forceRound(x, n): dailyweek_cost += float(value_wh / 1000 * price[f"BASE"]) else: dailyweek_cost += float(value_wh / 1000 * price[f"{measure_type}"]) + if measure_type != "BASE": attributes[f'dailyweek_{measure_type}'].append(str(forceRound(value_wh_total, 2))) attributes[f'dailyweek_cost{measure_type}'].append(str(forceRound(dailyweek_cost, 2))) attributes["dailyweek_cost"][day-1] += forceRound(dailyweek_cost, 2) + pprint(dailyweek_cost) if day == 1: attributes["daily_cost"] = attributes["dailyweek_cost"][day-1] if measure_type != "BASE": @@ -317,6 +320,8 @@ def forceRound(x, n): convert.append(str(tmp)) attributes["dailyweek_cost"] = convert + + peak_offpeak_percent = { 'HP': 0, 'HC': 0,