Skip to content
This repository was archived by the owner on Mar 5, 2025. It is now read-only.

Commit eab3702

Browse files
committed
Fixed timezone issues with charge slots sensor
1 parent 75ffc88 commit eab3702

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

custom_components/ohme/const.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
"""Component constants"""
22
DOMAIN = "ohme"
33
USER_AGENT = "dan-r-homeassistant-ohme"
4-
INTEGRATION_VERSION = "0.7.2"
4+
INTEGRATION_VERSION = "0.8.0"
55
CONFIG_VERSION = 1
66
ENTITY_TYPES = ["sensor", "binary_sensor", "switch", "button", "number", "time"]
77

custom_components/ohme/utils.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,8 +130,8 @@ def charge_graph_slot_list(charge_start, points, skip_format=False):
130130
# Append a dict to the slots list with the start and end time
131131
slots.append(
132132
{
133-
"start": datetime.utcfromtimestamp(result[0]).replace(tzinfo=pytz.utc),
134-
"end": datetime.utcfromtimestamp(result[1]).replace(tzinfo=pytz.utc),
133+
"start": datetime.utcfromtimestamp(result[0]).replace(tzinfo=pytz.utc).astimezone(),
134+
"end": datetime.utcfromtimestamp(result[1]).replace(tzinfo=pytz.utc).astimezone(),
135135
"charge_in_kwh": -(result[3] / 1000),
136136
"source": "smart-charge",
137137
"location": None

0 commit comments

Comments
 (0)