From afb8708fcfd518284879990f87634d2de7a974ce Mon Sep 17 00:00:00 2001 From: Joshua Leaper Date: Mon, 4 Nov 2024 19:59:59 +1030 Subject: [PATCH 1/2] Fix updateDisChargeConfigInfo not working -Also bump version to 0.5.6.1 --- custom_components/alphaess/coordinator.py | 2 +- custom_components/alphaess/manifest.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/custom_components/alphaess/coordinator.py b/custom_components/alphaess/coordinator.py index 28e7937..9b2207f 100644 --- a/custom_components/alphaess/coordinator.py +++ b/custom_components/alphaess/coordinator.py @@ -90,7 +90,7 @@ async def update_discharge(self, name, serial, time_period): start_time = datetime.strptime(start_time_str, "%H:%M").replace(year=now.year, month=now.month, day=now.day) future_time = start_time + timedelta(minutes=time_period) future_time_str = future_time.strftime("%H:%M") - return_data = await self.api.updateDisChargeConfigInfo(serial, batUseCap, 0, future_time_str, "00:00", + return_data = await self.api.updateDisChargeConfigInfo(serial, batUseCap, 1, future_time_str, "00:00", start_time.strftime("%H:%M"), "00:00") _LOGGER.info( f"Retrieved value for Discharge: {batUseCap} for serial: {serial} Running for {start_time.strftime('%H:%M')} to {future_time_str}") diff --git a/custom_components/alphaess/manifest.json b/custom_components/alphaess/manifest.json index 7aa63f2..150ea9b 100644 --- a/custom_components/alphaess/manifest.json +++ b/custom_components/alphaess/manifest.json @@ -15,7 +15,7 @@ "requirements": [ "alphaessopenapi==0.0.11" ], - "version": "0.5.6" + "version": "0.5.6.1" } From f4c0faf6a1352edb9ee77518ae6b9dc2cdc64715 Mon Sep 17 00:00:00 2001 From: Joshua Leaper Date: Mon, 4 Nov 2024 23:56:43 +1030 Subject: [PATCH 2/2] Enable it on reset_config --- custom_components/alphaess/coordinator.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/custom_components/alphaess/coordinator.py b/custom_components/alphaess/coordinator.py index 9b2207f..5dab61b 100644 --- a/custom_components/alphaess/coordinator.py +++ b/custom_components/alphaess/coordinator.py @@ -77,7 +77,7 @@ async def reset_config(self, serial): return_charge_data = await self.api.updateChargeConfigInfo(serial, batHighCap, 1, "00:00", "00:00", "00:00", "00:00") - return_discharge_data = await self.api.updateDisChargeConfigInfo(serial, batUseCap, 0, "00:00", "00:00", + return_discharge_data = await self.api.updateDisChargeConfigInfo(serial, batUseCap, 1, "00:00", "00:00", "00:00", "00:00") _LOGGER.info(