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

Improved logbook read function. #35

Merged
merged 1 commit into from
Feb 12, 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
6 changes: 3 additions & 3 deletions pycheckwatt/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,10 +152,11 @@ def _extract_fcr_d_state(self):
if fcrd_percentage is not None:
self.fcrd_info = fcrd_percentage
elif error_info is not None:
self.fcrd_info = error_info
error_info = error_info.split("]", 1)[0].strip()
self.fcrd_info = error_info.strip("[]").strip()
else:
self.fcrd_info = None
break # stop so we get the first row in logbook
break # stop so we get the first row in logbook

async def handle_client_error(self, endpoint, headers, error):
"""Handle ClientError and log relevant information."""
Expand Down Expand Up @@ -259,7 +260,6 @@ async def get_customer_details(self):
response.raise_for_status()
if response.status == 200:
self.customer_details = await response.json()
print(f"{json.dumps(self.customer_details, indent=4)}")

meters = self.customer_details.get("Meter", [])
if meters:
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.2.4"
version = "0.2.5"
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 @@ -4,7 +4,7 @@

MIN_PY_VERSION = "3.10"
PACKAGES = find_packages()
VERSION = "0.2.4"
VERSION = "0.2.5"

setup(
name="pycheckwatt",
Expand Down
Loading