From 664c4e6189dd4d1449e351502b8df0c3ca8eeaee Mon Sep 17 00:00:00 2001 From: Klaas Schoute Date: Wed, 10 Jul 2024 23:37:32 +0200 Subject: [PATCH] Fix small issue on Autarco integration (#121723) --- homeassistant/components/autarco/sensor.py | 1 + homeassistant/components/autarco/strings.json | 2 +- tests/components/autarco/snapshots/test_sensor.ambr | 9 ++++++--- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/homeassistant/components/autarco/sensor.py b/homeassistant/components/autarco/sensor.py index 32d93c7226d..79e8ad9e67d 100644 --- a/homeassistant/components/autarco/sensor.py +++ b/homeassistant/components/autarco/sensor.py @@ -60,6 +60,7 @@ SENSORS_SOLAR: tuple[AutarcoSolarSensorEntityDescription, ...] = ( translation_key="energy_production_total", native_unit_of_measurement=UnitOfEnergy.KILO_WATT_HOUR, device_class=SensorDeviceClass.ENERGY, + state_class=SensorStateClass.TOTAL_INCREASING, state=lambda solar: solar.energy_production_total, ), ) diff --git a/homeassistant/components/autarco/strings.json b/homeassistant/components/autarco/strings.json index 7ab81655764..9daf349de21 100644 --- a/homeassistant/components/autarco/strings.json +++ b/homeassistant/components/autarco/strings.json @@ -33,7 +33,7 @@ "name": "Energy production month" }, "energy_production_total": { - "name": "ENergy production total" + "name": "Energy production total" } } } diff --git a/tests/components/autarco/snapshots/test_sensor.ambr b/tests/components/autarco/snapshots/test_sensor.ambr index 77a400182b6..b41212fa00d 100644 --- a/tests/components/autarco/snapshots/test_sensor.ambr +++ b/tests/components/autarco/snapshots/test_sensor.ambr @@ -100,7 +100,9 @@ 'aliases': set({ }), 'area_id': None, - 'capabilities': None, + 'capabilities': dict({ + 'state_class': , + }), 'config_entry_id': , 'device_class': None, 'device_id': , @@ -119,7 +121,7 @@ }), 'original_device_class': , 'original_icon': None, - 'original_name': 'ENergy production total', + 'original_name': 'Energy production total', 'platform': 'autarco', 'previous_unique_id': None, 'supported_features': 0, @@ -132,7 +134,8 @@ StateSnapshot({ 'attributes': ReadOnlyDict({ 'device_class': 'energy', - 'friendly_name': 'Solar ENergy production total', + 'friendly_name': 'Solar Energy production total', + 'state_class': , 'unit_of_measurement': , }), 'context': ,