Skip to content

Commit

Permalink
Fixed timezone issues with charge slots sensor (#70)
Browse files Browse the repository at this point in the history
  • Loading branch information
dan-r authored Apr 2, 2024
1 parent 75ffc88 commit 9ccadbb
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion custom_components/ohme/const.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""Component constants"""
DOMAIN = "ohme"
USER_AGENT = "dan-r-homeassistant-ohme"
INTEGRATION_VERSION = "0.7.2"
INTEGRATION_VERSION = "0.8.0"
CONFIG_VERSION = 1
ENTITY_TYPES = ["sensor", "binary_sensor", "switch", "button", "number", "time"]

Expand Down
4 changes: 2 additions & 2 deletions custom_components/ohme/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,8 +130,8 @@ def charge_graph_slot_list(charge_start, points, skip_format=False):
# Append a dict to the slots list with the start and end time
slots.append(
{
"start": datetime.utcfromtimestamp(result[0]).replace(tzinfo=pytz.utc),
"end": datetime.utcfromtimestamp(result[1]).replace(tzinfo=pytz.utc),
"start": datetime.utcfromtimestamp(result[0]).replace(tzinfo=pytz.utc).astimezone(),
"end": datetime.utcfromtimestamp(result[1]).replace(tzinfo=pytz.utc).astimezone(),
"charge_in_kwh": -(result[3] / 1000),
"source": "smart-charge",
"location": None
Expand Down

0 comments on commit 9ccadbb

Please sign in to comment.