mirror of
https://github.com/home-assistant/core.git
synced 2025-07-26 22:57:17 +00:00
Fix SAJ Solar inverter RecursionError (#71157)
This commit is contained in:
parent
f35e7d1129
commit
a74f035ae7
@ -209,14 +209,11 @@ class SAJsensor(SensorEntity):
|
|||||||
@property
|
@property
|
||||||
def device_class(self):
|
def device_class(self):
|
||||||
"""Return the device class the sensor belongs to."""
|
"""Return the device class the sensor belongs to."""
|
||||||
if self.unit_of_measurement == POWER_WATT:
|
if self.native_unit_of_measurement == POWER_WATT:
|
||||||
return SensorDeviceClass.POWER
|
return SensorDeviceClass.POWER
|
||||||
if self.unit_of_measurement == ENERGY_KILO_WATT_HOUR:
|
if self.native_unit_of_measurement == ENERGY_KILO_WATT_HOUR:
|
||||||
return SensorDeviceClass.ENERGY
|
return SensorDeviceClass.ENERGY
|
||||||
if (
|
if self.native_unit_of_measurement in (TEMP_CELSIUS, TEMP_FAHRENHEIT):
|
||||||
self.unit_of_measurement == TEMP_CELSIUS
|
|
||||||
or self._sensor.unit == TEMP_FAHRENHEIT
|
|
||||||
):
|
|
||||||
return SensorDeviceClass.TEMPERATURE
|
return SensorDeviceClass.TEMPERATURE
|
||||||
|
|
||||||
@property
|
@property
|
||||||
|
Loading…
x
Reference in New Issue
Block a user