Skip to content

Commit

Permalink
fix pip
Browse files Browse the repository at this point in the history
  • Loading branch information
m4dm4rtig4n committed Oct 15, 2021
1 parent 0313da0 commit 1eba9f6
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion app/myenedis.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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":
Expand All @@ -317,6 +320,8 @@ def forceRound(x, n):
convert.append(str(tmp))
attributes["dailyweek_cost"] = convert



peak_offpeak_percent = {
'HP': 0,
'HC': 0,
Expand Down

0 comments on commit 1eba9f6

Please sign in to comment.