Skip to content

Commit

Permalink
remove unknown TAGs from ALARM_BITS if not supported by Waterkotte de…
Browse files Browse the repository at this point in the history
…vice
  • Loading branch information
marq24 committed May 8, 2024
1 parent b13c759 commit 4017c3d
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions custom_components/waterkotte_heatpump/pywaterkotte_ha/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,13 @@ async def _read_tags(self, tags: Sequence[WKHPTag], results=None, results_status
re.MULTILINE,
)
if match is None:
_LOGGER.warning(f"Tag: '{tag}' not found in response!")
# special handling for "unknown" tags in the ALARM_BITS field... [if one of the
# I2xxx Tags is not known, we're simply going to remove that tag from the tag list]
if tag in WKHPTag.ALARM_BITS.tags:
WKHPTag.ALARM_BITS.tags.remove(tag)
_LOGGER.info(f"Tag: '{tag}' not found in response - removing tag from WKHPTag.ALARM_BITS")
else:
_LOGGER.warning(f"Tag: '{tag}' not found in response!")
results_status[tag] = "E_NOTFOUND"
else:
results_status[tag] = "E_INACTIVE"
Expand Down Expand Up @@ -546,7 +552,13 @@ async def _read_tags(self, tags: Sequence[WKHPTag], results=None, results_status
# val_status = "E_INACTIVE" # pylint: disable=possibly-unused-variable
# print("Tag: %s is inactive!", tag)
if match is None:
_LOGGER.warning(f"Tag: '{tag}' not found in response!")
# special handling for "unknown" tags in the ALARM_BITS field... [if one of the
# I2xxx Tags is not known, we're simply going to remove that tag from the tag list]
if tag in WKHPTag.ALARM_BITS.tags:
WKHPTag.ALARM_BITS.tags.remove(tag)
_LOGGER.info(f"Tag: '{tag}' not found in response - removing tag from WKHPTag.ALARM_BITS")
else:
_LOGGER.warning(f"Tag: '{tag}' not found in response!")
results_status[tag] = "E_NOTFOUND"
else:
# if val_status == "E_INACTIVE":
Expand Down

0 comments on commit 4017c3d

Please sign in to comment.