Skip to content

Commit

Permalink
Use native_unit_of_measurement to prevent recursion. (#209)
Browse files Browse the repository at this point in the history
Co-authored-by: Felix Stürmer <[email protected]>
  • Loading branch information
pfetzing and weltenwort authored May 8, 2022
1 parent 436df7d commit 9e1202d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions custom_components/rct_power/lib/entity.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,8 +130,8 @@ def device_class(self):
if device_class := super().device_class:
return device_class

if self.unit_of_measurement:
return guess_device_class_from_unit(self.unit_of_measurement)
if self.native_unit_of_measurement:
return guess_device_class_from_unit(self.native_unit_of_measurement)

return None

Expand Down

0 comments on commit 9e1202d

Please sign in to comment.