Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Grid and Solar Power properties added #24

Merged
merged 1 commit into from
Jan 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions pycheckwatt/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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."""
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -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 <[email protected]>", "Anders Yderborg <[email protected]>", "Daniel Nilsson <[email protected]>"]
license = "MIT License"
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

MIN_PY_VERSION = "3.10"
PACKAGES = find_packages()
VERSION = "0.1.0"
VERSION = "0.1.7"

setup(
name="pycheckwatt",
Expand Down
Loading