Skip to content

Commit

Permalink
add debug logging to easycon.py
Browse files Browse the repository at this point in the history
  • Loading branch information
pattisonmichael committed Dec 8, 2023
1 parent 7757f51 commit 5333f3c
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 13 deletions.
29 changes: 17 additions & 12 deletions pywaterkotte/easycon.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,18 +83,23 @@ async def _read_tags(
) as resp:
r = await resp.text() # pylint: disable=invalid-name
# print(r)
tree = ET.fromstring(r)
root = tree[0]
# for types in root[0]:
# print(types.tag)

for tagType in root:
# print(tag_type)
for tag in tagType:
# print(tag)
if int(tag[0].text) < 50:
print(f"{tagType.tag[0]}{tag[0].text}={tag[1].text}")

try:
tree = ET.fromstring(r)
root = tree[0]
# for types in root[0]:
# print(types.tag)

for tagType in root:
# print(tag_type)
for tag in tagType:
# print(tag)
if int(tag[0].text) < 50:
print(f"{tagType.tag[0]}{tag[0].text}={tag[1].text}")
except:
print(resp)
print(f"Error in easycon.py parsing response. Received: {r}")

raise Exception(f"Error in easycon.py parsing response. Received: {r}")
# return None, None

for tag in tags:
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

setuptools.setup(
name="pywaterkotte2",
version="0.0.11",
version="0.0.12",
author="Michael Pattison",
author_email="[email protected]",
description="python library for waterkotte heatpumps",
Expand Down

0 comments on commit 5333f3c

Please sign in to comment.