Skip to content

Commit

Permalink
Remove ms from predbat slots
Browse files Browse the repository at this point in the history
  • Loading branch information
dan-r committed Jul 7, 2024
1 parent 48082d5 commit 5ec6a42
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions custom_components/ohme/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ def slot_list(data):
for slot in session_slots:
slots.append(
{
"start": datetime.utcfromtimestamp(slot['startTimeMs'] / 1000).replace(tzinfo=pytz.utc).astimezone(),
"end": datetime.utcfromtimestamp(slot['endTimeMs'] / 1000).replace(tzinfo=pytz.utc).astimezone(),
"start": datetime.utcfromtimestamp(slot['startTimeMs'] / 1000).replace(tzinfo=pytz.utc, microsecond=0).astimezone(),
"end": datetime.utcfromtimestamp(slot['endTimeMs'] / 1000).replace(tzinfo=pytz.utc, microsecond=0).astimezone(),
"charge_in_kwh": -((slot['estimatedSoc']['wh'] - wh_tally) / 1000), # Work out how much we add in just this slot
"source": "smart-charge",
"location": None
Expand Down

0 comments on commit 5ec6a42

Please sign in to comment.