Skip to content

Commit

Permalink
Ignore this else suggestion
Browse files Browse the repository at this point in the history
  • Loading branch information
klaasnicolaas committed Dec 30, 2023
1 parent 77356a7 commit 90c6ebf
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/omnikinverter/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ def get_value(search_key: str) -> Any:
if search_key in ["webdata_today_e", "webdata_total_e"]:
return float(match)
return match
return None
return None # noqa: TRY300
except AttributeError as exception:
msg = "Your inverter has no data source from a html file."
raise OmnikInverterWrongSourceError(msg) from exception
Expand Down Expand Up @@ -173,7 +173,7 @@ def get_value(position: int) -> Any:
energy_value = float(matches[position]) / 10
return energy_value
return matches[position].replace(" ", "")
return None
return None # noqa: TRY300
except AttributeError as exception:
msg = "Your inverter has no data source from a javascript file."
raise OmnikInverterWrongSourceError(msg) from exception
Expand Down

0 comments on commit 90c6ebf

Please sign in to comment.