Skip to content

Commit

Permalink
Fix Home Assistant 2023.5.x error
Browse files Browse the repository at this point in the history
The fix for #474
  • Loading branch information
stickpin authored May 8, 2023
1 parent 8cf825e commit 4e7aefa
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion custom_components/volkswagencarnet/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,8 @@ def _attr_native_value(self):
@property
def _attr_native_unit_of_measurement(self):
"""Return the unit of measurement."""
return self.instrument.unit
if self.instrument.unit:
return self.instrument.unit

@property
def device_class(self) -> Union[SensorDeviceClass, None]:
Expand Down

0 comments on commit 4e7aefa

Please sign in to comment.