Skip to content

Commit

Permalink
fix value error for stations where state value is not found
Browse files Browse the repository at this point in the history
  • Loading branch information
pantherale0 committed Jun 20, 2024
1 parent f9208b6 commit c0d2b50
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions custom_components/fuel_prices/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,13 +94,13 @@ def name(self) -> str:
@property
def native_unit_of_measurement(self) -> str:
"""Return unit of measurement."""
if self.state_value == "name":
if isinstance(self.native_value, str):
return None
return self._fuel_station.currency.upper()

@property
def state_class(self) -> str:
"""Return state type."""
if self.state_value == "name":
if isinstance(self.native_value, str):
return None
return "total"

0 comments on commit c0d2b50

Please sign in to comment.