From d766b1732352fbf5a10be2bb56fe7d710d87592a Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Tue, 1 Mar 2022 14:00:48 -1000 Subject: [PATCH] Partially revert powerwall abs change from #67245 (#67300) --- homeassistant/components/powerwall/sensor.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/homeassistant/components/powerwall/sensor.py b/homeassistant/components/powerwall/sensor.py index bc8ab1c021..93b3c64d18 100644 --- a/homeassistant/components/powerwall/sensor.py +++ b/homeassistant/components/powerwall/sensor.py @@ -114,7 +114,7 @@ class PowerWallEnergySensor(PowerWallEntity, SensorEntity): class PowerWallEnergyDirectionSensor(PowerWallEntity, SensorEntity): """Representation of an Powerwall Direction Energy sensor.""" - _attr_state_class = SensorStateClass.TOTAL_INCREASING + _attr_state_class = SensorStateClass.TOTAL _attr_native_unit_of_measurement = ENERGY_KILO_WATT_HOUR _attr_device_class = SensorDeviceClass.ENERGY @@ -160,7 +160,7 @@ class PowerWallExportSensor(PowerWallEnergyDirectionSensor): @property def native_value(self) -> float: """Get the current value in kWh.""" - return abs(self.meter.get_energy_exported()) + return self.meter.get_energy_exported() class PowerWallImportSensor(PowerWallEnergyDirectionSensor): @@ -177,4 +177,4 @@ class PowerWallImportSensor(PowerWallEnergyDirectionSensor): @property def native_value(self) -> float: """Get the current value in kWh.""" - return abs(self.meter.get_energy_imported()) + return self.meter.get_energy_imported()