From e6ebc4df334dccdd248429d00d8e209e230f1205 Mon Sep 17 00:00:00 2001 From: faanskit Date: Thu, 4 Jan 2024 12:35:58 +0100 Subject: [PATCH] Grid and Solar Power properties added --- pycheckwatt/__init__.py | 20 ++++++++++++++++++++ pyproject.toml | 2 +- setup.py | 2 +- 3 files changed, 22 insertions(+), 2 deletions(-) diff --git a/pycheckwatt/__init__.py b/pycheckwatt/__init__.py index 277d23b..a2742ce 100644 --- a/pycheckwatt/__init__.py +++ b/pycheckwatt/__init__.py @@ -782,6 +782,26 @@ def battery_power(self): _LOGGER.warning("Unable to retrieve Battery Power") return None + @property + def grid_power(self): + """Property for Grid Power.""" + if self.energy_data is not None: + if "GridNow" in self.energy_data: + return self.energy_data["GridNow"] + + _LOGGER.warning("Unable to retrieve Grid Power") + return None + + @property + def solar_power(self): + """Property for Solar Power.""" + if self.energy_data is not None: + if "SolarNow" in self.energy_data: + return self.energy_data["SolarNow"] + + _LOGGER.warning("Unable to retrieve Solar Power") + return None + @property def battery_soc(self): """Property for Battery SoC.""" diff --git a/pyproject.toml b/pyproject.toml index 6992389..f01fc2f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "pycheckwatt" -version = "0.1.6" +version = "0.1.7" description = "Read data from CheckWatts EnergyInBalance WEB API" authors = ["Marcus Karlsson ", "Anders Yderborg ", "Daniel Nilsson "] license = "MIT License" diff --git a/setup.py b/setup.py index 619dbd8..beffbc6 100644 --- a/setup.py +++ b/setup.py @@ -3,7 +3,7 @@ MIN_PY_VERSION = "3.10" PACKAGES = find_packages() -VERSION = "0.1.0" +VERSION = "0.1.7" setup( name="pycheckwatt",