Skip to content

Commit

Permalink
Fixed the bug introduced in v0.1.1
Browse files Browse the repository at this point in the history
Starting history attribute counter from 0 (to match date.hour);
This will remove the 1 hour offset - bug intorduced in previous release

Signed-off-by: Vadim Grinco <[email protected]>
  • Loading branch information
grinco committed Oct 19, 2021
1 parent 9f0026d commit 4f764fa
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ def _get_current_value(self):
for values in json['data']['dataLine']:
if values['title'] == cost_string:
for data in values['point']:
history_index = int(data[hour_axis])
history_index = int(data[hour_axis])-1
cost_history[history_index] = float(data[cost_axis])
current_cost = cost_history[date.hour]

Expand Down

0 comments on commit 4f764fa

Please sign in to comment.