Skip to content

Commit

Permalink
ruff fix
Browse files Browse the repository at this point in the history
  • Loading branch information
hectorzin committed Dec 17, 2024
1 parent 0f65363 commit 205a30c
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions custom_components/aliexpress_openplatform/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,10 @@ def _determine_time_range(self, now: datetime) -> tuple[datetime, datetime]:

def _get_api_credentials(self) -> dict[str, str]:
"""Extract API credentials from the configuration entry."""
if self.config_entry is None:
error_message = "Config entry is None. Cannot access configuration data."
raise ValueError(error_message)

return {
"app_key": self.config_entry.data[CONF_APP_KEY],
"app_secret": self.config_entry.data[CONF_APP_SECRET],
Expand Down

0 comments on commit 205a30c

Please sign in to comment.