Skip to content

Commit

Permalink
add not supported sensors
Browse files Browse the repository at this point in the history
  • Loading branch information
leeyuentuen committed Jan 3, 2024
1 parent a460906 commit eaea413
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions custom_components/polestar_api/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -467,6 +467,11 @@ def native_unit_of_measurement(self) -> str | None:
@property
def state(self) -> StateType:
"""Return the state of the sensor."""

if self._attr_native_value is None and self.entity_description.key in ('charging_current_amps', 'charging_power_watts', 'estimated_charging_time_minutes_to_target_distance'):
self.entity_description.unit = None
return "Not Supported Yet"

if self.entity_description.dict_data is not None:
# exception for api_status_code
if self.entity_description.key == 'api_status_code':
Expand Down

0 comments on commit eaea413

Please sign in to comment.