Skip to content

Commit

Permalink
Add note to open an issue for unknown classifier
Browse files Browse the repository at this point in the history
  • Loading branch information
HandyHat committed Jan 2, 2023
1 parent 7d2aee8 commit c250bb2
Showing 1 changed file with 13 additions and 5 deletions.
18 changes: 13 additions & 5 deletions custom_components/hildebrandglow_dcc/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ def supply_type(resource) -> str:
return "electricity"
if "gas.consumption" in resource.classifier:
return "gas"
_LOGGER.error("Unknown classifier: %s", resource.classifier)
_LOGGER.error("Unknown classifier: %s. Please open an issue.", resource.classifier)
return "unknown"


Expand Down Expand Up @@ -167,7 +167,9 @@ async def daily_data(self) -> float:
except requests.exceptions.ConnectionError as secondary_ex:
_LOGGER.error("Cannot connect: %s", secondary_ex)
except Exception as secondary_ex: # pylint: disable=broad-except
_LOGGER.exception("Unexpected exception: %s. Please open an issue.", secondary_ex)
_LOGGER.exception(
"Unexpected exception: %s. Please open an issue.", secondary_ex
)
else:
_LOGGER.exception("Unexpected exception: %s. Please open an issue.", ex)
_LOGGER.debug(
Expand Down Expand Up @@ -197,7 +199,9 @@ async def daily_data(self) -> float:
except requests.exceptions.ConnectionError as secondary_ex:
_LOGGER.error("Cannot connect: %s", secondary_ex)
except Exception as secondary_ex: # pylint: disable=broad-except
_LOGGER.exception("Unexpected exception: %s. Please open an issue.", secondary_ex)
_LOGGER.exception(
"Unexpected exception: %s. Please open an issue.", secondary_ex
)
else:
_LOGGER.exception("Unexpected exception: %s. Please open an issue.", ex)
_LOGGER.debug("Successfully got daily usage for resource id %s", self.resource.id)
Expand Down Expand Up @@ -226,7 +230,9 @@ async def tariff_data(self) -> float:
except requests.exceptions.ConnectionError as secondary_ex:
_LOGGER.error("Cannot connect: %s", secondary_ex)
except Exception as secondary_ex: # pylint: disable=broad-except
_LOGGER.exception("Unexpected exception: %s. Please open an issue.", secondary_ex)
_LOGGER.exception(
"Unexpected exception: %s. Please open an issue.", secondary_ex
)
else:
_LOGGER.exception("Unexpected exception: %s. Please open an issue.", ex)
_LOGGER.debug(
Expand Down Expand Up @@ -255,7 +261,9 @@ async def refresh_token(self):
except requests.exceptions.ConnectionError as ex:
raise ConfigEntryNotReady(f"Cannot connect: {ex}") from ex
except Exception as ex: # pylint: disable=broad-except
raise ConfigEntryNotReady(f"Unexpected exception: {ex}. Please open an issue.") from ex
raise ConfigEntryNotReady(
f"Unexpected exception: {ex}. Please open an issue."
) from ex
else:
_LOGGER.debug("Successful Post to %sauth", glowmarkt.url)

Expand Down

0 comments on commit c250bb2

Please sign in to comment.