From f79de2a5bc42ae333fa1996eddcbfadedc8b89a8 Mon Sep 17 00:00:00 2001 From: popoviciri Date: Thu, 9 Sep 2021 20:19:49 +0200 Subject: [PATCH] Bump pysma to 0.6.6 & Fix Unit Checks (#56018) --- homeassistant/components/sma/manifest.json | 2 +- homeassistant/components/sma/sensor.py | 4 ++-- requirements_all.txt | 2 +- requirements_test_all.txt | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/homeassistant/components/sma/manifest.json b/homeassistant/components/sma/manifest.json index a462d0c854b..da24627d268 100644 --- a/homeassistant/components/sma/manifest.json +++ b/homeassistant/components/sma/manifest.json @@ -3,7 +3,7 @@ "name": "SMA Solar", "config_flow": true, "documentation": "https://www.home-assistant.io/integrations/sma", - "requirements": ["pysma==0.6.5"], + "requirements": ["pysma==0.6.6"], "codeowners": ["@kellerza", "@rklomp"], "iot_class": "local_polling" } diff --git a/homeassistant/components/sma/sensor.py b/homeassistant/components/sma/sensor.py index f0a10a5d5e1..922ec9f9212 100644 --- a/homeassistant/components/sma/sensor.py +++ b/homeassistant/components/sma/sensor.py @@ -166,10 +166,10 @@ class SMAsensor(CoordinatorEntity, SensorEntity): self._config_entry_unique_id = config_entry_unique_id self._device_info = device_info - if self.unit_of_measurement == ENERGY_KILO_WATT_HOUR: + if self.native_unit_of_measurement == ENERGY_KILO_WATT_HOUR: self._attr_state_class = STATE_CLASS_TOTAL_INCREASING self._attr_device_class = DEVICE_CLASS_ENERGY - if self.unit_of_measurement == POWER_WATT: + if self.native_unit_of_measurement == POWER_WATT: self._attr_state_class = STATE_CLASS_MEASUREMENT self._attr_device_class = DEVICE_CLASS_POWER diff --git a/requirements_all.txt b/requirements_all.txt index 818981947c5..73e21ea4ec9 100644 --- a/requirements_all.txt +++ b/requirements_all.txt @@ -1781,7 +1781,7 @@ pysignalclirestapi==0.3.4 pyskyqhub==0.1.3 # homeassistant.components.sma -pysma==0.6.5 +pysma==0.6.6 # homeassistant.components.smappee pysmappee==0.2.27 diff --git a/requirements_test_all.txt b/requirements_test_all.txt index 62e13269a31..a661f772dcf 100644 --- a/requirements_test_all.txt +++ b/requirements_test_all.txt @@ -1031,7 +1031,7 @@ pysiaalarm==3.0.0 pysignalclirestapi==0.3.4 # homeassistant.components.sma -pysma==0.6.5 +pysma==0.6.6 # homeassistant.components.smappee pysmappee==0.2.27