From 484ece40edcd3f9df7a15ea0b99d093263c52022 Mon Sep 17 00:00:00 2001 From: Dan Raper Date: Thu, 15 Feb 2024 22:55:30 +0000 Subject: [PATCH] Fix bug in charge target setting (#62) * Fix target time setting * Version bump --- custom_components/ohme/const.py | 2 +- custom_components/ohme/utils.py | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/custom_components/ohme/const.py b/custom_components/ohme/const.py index 8f30ab4..f0ddced 100644 --- a/custom_components/ohme/const.py +++ b/custom_components/ohme/const.py @@ -1,7 +1,7 @@ """Component constants""" DOMAIN = "ohme" USER_AGENT = "dan-r-homeassistant-ohme" -INTEGRATION_VERSION = "0.7.0" +INTEGRATION_VERSION = "0.7.1" CONFIG_VERSION = 1 ENTITY_TYPES = ["sensor", "binary_sensor", "switch", "button", "number", "time"] diff --git a/custom_components/ohme/utils.py b/custom_components/ohme/utils.py index 1648727..dc1776d 100644 --- a/custom_components/ohme/utils.py +++ b/custom_components/ohme/utils.py @@ -164,6 +164,7 @@ def charge_graph_in_slot(charge_start, points, skip_format=False): def time_next_occurs(hour, minute): """Find when this time next occurs.""" + current = datetime.now() target = current.replace(hour=hour, minute=minute, second=0, microsecond=0) if target <= datetime.now(): target = target + timedelta(days=1)