Fix Aurora abb incorrect attr (#58450)

This commit is contained in:
Robert Hillis
2021-10-26 00:12:21 -04:00
committed by GitHub
parent 65b19da3ff
commit 2517ba59b5

View File

@@ -79,7 +79,7 @@ class AuroraSensor(AuroraDevice, SensorEntity):
super().__init__(client, data)
if typename == "instantaneouspower":
self.type = typename
self._attr_unit_of_measurement = POWER_WATT
self._attr_native_unit_of_measurement = POWER_WATT
self._attr_device_class = DEVICE_CLASS_POWER
elif typename == "temperature":
self.type = typename
@@ -101,7 +101,7 @@ class AuroraSensor(AuroraDevice, SensorEntity):
if self.type == "instantaneouspower":
# read ADC channel 3 (grid power output)
power_watts = self.client.measure(3, True)
self._attr_state = round(power_watts, 1)
self._attr_native_value = round(power_watts, 1)
elif self.type == "temperature":
temperature_c = self.client.measure(21)
self._attr_native_value = round(temperature_c, 1)