Skip to content

Commit

Permalink
add error message to KeyError
Browse files Browse the repository at this point in the history
  • Loading branch information
mampfes committed Jan 21, 2024
1 parent 63f8392 commit 866c608
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion custom_components/epex_spot_sensor/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ def __init__(self, entry):
self._price = x
self._price_uom = "pence/kWh"
else:
raise KeyError()
raise KeyError("No valid price field found. Check sensor.")

def __repr__(self):
return f"{self.__class__.__name__}(start: {self._start_time.isoformat()}, end: {self._end_time.isoformat()}, marketprice: {self._price} {self._price_uom})" # noqa: E501
Expand Down

0 comments on commit 866c608

Please sign in to comment.