From 9ca1b1cd55a993b2ec6d36d22b93ec2eb73f37de Mon Sep 17 00:00:00 2001 From: faanskit Date: Sun, 11 Feb 2024 21:32:30 +0000 Subject: [PATCH] Fixed bug in old systems --- custom_components/checkwatt/__init__.py | 3 ++- custom_components/checkwatt/manifest.json | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/custom_components/checkwatt/__init__.py b/custom_components/checkwatt/__init__.py index 5a255fe..991f7b9 100644 --- a/custom_components/checkwatt/__init__.py +++ b/custom_components/checkwatt/__init__.py @@ -437,10 +437,11 @@ async def _async_update_data(self) -> CheckwattResp: # noqa: C901 "zip": cw_inst.customer_details["ZipCode"], "city": cw_inst.customer_details["City"], "display_name": cw_inst.display_name, - "dso": cw_inst.battery_registration["Dso"], "energy_provider": self.energy_provider, "reseller_id": cw_inst.reseller_id, } + if cw_inst.battery_registration is not None: + resp["dso"] = cw_inst.battery_registration["Dso"] if cw_inst.energy_data is not None: resp["battery_power"] = cw_inst.battery_power resp["grid_power"] = cw_inst.grid_power diff --git a/custom_components/checkwatt/manifest.json b/custom_components/checkwatt/manifest.json index 4fae6c8..cb3b7d7 100644 --- a/custom_components/checkwatt/manifest.json +++ b/custom_components/checkwatt/manifest.json @@ -12,7 +12,7 @@ "homekit": {}, "iot_class": "cloud_polling", "issue_tracker": "https://github.com/faanskit/ha-checkwatt/issues", - "requirements": ["pycheckwatt>=0.2.3", "aiohttp>=3.9.1"], + "requirements": ["pycheckwatt>=0.2.4", "aiohttp>=3.9.1"], "ssdp": [], "version": "0.2.1", "zeroconf": []