From d6fe5b2214bb6c65ea76e9966ed394b63b15ddca Mon Sep 17 00:00:00 2001 From: Marc Billow Date: Fri, 17 Feb 2023 14:12:29 -0600 Subject: [PATCH 1/3] Switch to async_forward_entry_setups --- custom_components/chargepoint/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/custom_components/chargepoint/__init__.py b/custom_components/chargepoint/__init__.py index 856b51e..e793fb3 100755 --- a/custom_components/chargepoint/__init__.py +++ b/custom_components/chargepoint/__init__.py @@ -187,7 +187,7 @@ async def async_update_data(is_retry: bool = False): await coordinator.async_config_entry_first_refresh() # Setup components - hass.config_entries.async_setup_platforms(entry, PLATFORMS) + await hass.config_entries.async_forward_entry_setups(entry, PLATFORMS) return True From 0781ef6b79839a1c11d6e229895ba896fd76963c Mon Sep 17 00:00:00 2001 From: Marc Billow Date: Fri, 17 Feb 2023 14:15:32 -0600 Subject: [PATCH 2/3] Move both charge_cost and account_balance to SDClass.TOTAL --- custom_components/chargepoint/sensor.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/custom_components/chargepoint/sensor.py b/custom_components/chargepoint/sensor.py index 173b984..cae8a10 100755 --- a/custom_components/chargepoint/sensor.py +++ b/custom_components/chargepoint/sensor.py @@ -126,7 +126,7 @@ def native_value(self): icon="mdi:wallet", device_class=SensorDeviceClass.MONETARY, unit=lambda entity: entity.account.account_balance.currency, - state_class=SensorStateClass.MEASUREMENT, + state_class=SensorStateClass.TOTAL, value=lambda entity: f"{float(entity.account.account_balance.amount):.2f}", ), ] @@ -227,7 +227,7 @@ def native_value(self): key="session_cost", name_suffix="Charge Cost", icon="mdi:cash-multiple", - state_class=SensorStateClass.TOTAL_INCREASING, + state_class=SensorStateClass.TOTAL, device_class=SensorDeviceClass.MONETARY, value=lambda entity: f"{entity.session.total_amount:.2f}" if entity.session From 259306d76f959df8e616e73b7802fe762cafa0af Mon Sep 17 00:00:00 2001 From: Marc Billow Date: Fri, 17 Feb 2023 14:16:26 -0600 Subject: [PATCH 3/3] Bump version to 0.4.0 --- custom_components/chargepoint/const.py | 2 +- custom_components/chargepoint/manifest.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/custom_components/chargepoint/const.py b/custom_components/chargepoint/const.py index e9cf20a..f46c3bf 100755 --- a/custom_components/chargepoint/const.py +++ b/custom_components/chargepoint/const.py @@ -6,7 +6,7 @@ NAME = "ChargePoint" DOMAIN = "chargepoint" DOMAIN_DATA = f"{DOMAIN}_data" -VERSION = "0.3.0" +VERSION = "0.4.0" ATTRIBUTION = "Data provided by https://www.chargepoint.com" ISSUE_URL = "https://github.com/mbillow/ha-chargepoint/issues" diff --git a/custom_components/chargepoint/manifest.json b/custom_components/chargepoint/manifest.json index bfb5950..c83da1d 100755 --- a/custom_components/chargepoint/manifest.json +++ b/custom_components/chargepoint/manifest.json @@ -8,6 +8,6 @@ ], "config_flow": true, "issue_tracker": "https://github.com/mbillow/ha-chargepoint/issues", - "version": "0.3.1", + "version": "0.4.0", "iot_class": "cloud_polling" }