From 9a5f509ab905da3c3c8005dc094fca21b7b86efe Mon Sep 17 00:00:00 2001 From: "A. Gideonse" Date: Mon, 9 Mar 2026 13:49:54 +0100 Subject: [PATCH] Fix missing Gen-2 sensor for the Indevolt integration (#165133) --- homeassistant/components/indevolt/const.py | 1 + homeassistant/components/indevolt/sensor.py | 1 - tests/components/indevolt/fixtures/gen_2.json | 1 + .../indevolt/snapshots/test_diagnostics.ambr | 1 + .../indevolt/snapshots/test_sensor.ambr | 60 +++++++++++++++++++ 5 files changed, 63 insertions(+), 1 deletion(-) diff --git a/homeassistant/components/indevolt/const.py b/homeassistant/components/indevolt/const.py index 2f6b7338330d..17d857dee51b 100644 --- a/homeassistant/components/indevolt/const.py +++ b/homeassistant/components/indevolt/const.py @@ -102,5 +102,6 @@ SENSOR_KEYS = { "11009", "11010", "6105", + "1505", ], } diff --git a/homeassistant/components/indevolt/sensor.py b/homeassistant/components/indevolt/sensor.py index 3ccfeec8571c..75040bf8e7ee 100644 --- a/homeassistant/components/indevolt/sensor.py +++ b/homeassistant/components/indevolt/sensor.py @@ -234,7 +234,6 @@ SENSORS: Final = ( ), IndevoltSensorEntityDescription( key="1505", - generation=[1], translation_key="cumulative_production", native_unit_of_measurement=UnitOfEnergy.WATT_HOUR, suggested_unit_of_measurement=UnitOfEnergy.KILO_WATT_HOUR, diff --git a/tests/components/indevolt/fixtures/gen_2.json b/tests/components/indevolt/fixtures/gen_2.json index 0532a38b5c2d..e267a9aafb11 100644 --- a/tests/components/indevolt/fixtures/gen_2.json +++ b/tests/components/indevolt/fixtures/gen_2.json @@ -15,6 +15,7 @@ "2105": 2000, "11034": 100, "1502": 0, + "1505": 553673, "6004": 0.07, "6005": 0, "6006": 380.58, diff --git a/tests/components/indevolt/snapshots/test_diagnostics.ambr b/tests/components/indevolt/snapshots/test_diagnostics.ambr index 8bd050520ce4..017ebe8b43ba 100644 --- a/tests/components/indevolt/snapshots/test_diagnostics.ambr +++ b/tests/components/indevolt/snapshots/test_diagnostics.ambr @@ -51,6 +51,7 @@ '142': 1.79, '1501': 0, '1502': 0, + '1505': 553673, '1532': 150, '1600': 48.5, '1601': 48.3, diff --git a/tests/components/indevolt/snapshots/test_sensor.ambr b/tests/components/indevolt/snapshots/test_sensor.ambr index 48e3194e7817..e7aceb988bfd 100644 --- a/tests/components/indevolt/snapshots/test_sensor.ambr +++ b/tests/components/indevolt/snapshots/test_sensor.ambr @@ -2866,6 +2866,66 @@ 'state': '0', }) # --- +# name: test_sensor[2][sensor.cms_sf2000_cumulative_production-entry] + EntityRegistryEntrySnapshot({ + 'aliases': set({ + }), + 'area_id': None, + 'capabilities': dict({ + 'state_class': , + }), + 'config_entry_id': , + 'config_subentry_id': , + 'device_class': None, + 'device_id': , + 'disabled_by': None, + 'domain': 'sensor', + 'entity_category': None, + 'entity_id': 'sensor.cms_sf2000_cumulative_production', + 'has_entity_name': True, + 'hidden_by': None, + 'icon': None, + 'id': , + 'labels': set({ + }), + 'name': None, + 'object_id_base': 'Cumulative production', + 'options': dict({ + 'sensor': dict({ + 'suggested_display_precision': 2, + }), + 'sensor.private': dict({ + 'suggested_unit_of_measurement': , + }), + }), + 'original_device_class': , + 'original_icon': None, + 'original_name': 'Cumulative production', + 'platform': 'indevolt', + 'previous_unique_id': None, + 'suggested_object_id': None, + 'supported_features': 0, + 'translation_key': 'cumulative_production', + 'unique_id': 'SolidFlex2000-87654321_1505', + 'unit_of_measurement': , + }) +# --- +# name: test_sensor[2][sensor.cms_sf2000_cumulative_production-state] + StateSnapshot({ + 'attributes': ReadOnlyDict({ + 'device_class': 'energy', + 'friendly_name': 'CMS-SF2000 Cumulative production', + 'state_class': , + 'unit_of_measurement': , + }), + 'context': , + 'entity_id': 'sensor.cms_sf2000_cumulative_production', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': '553.673', + }) +# --- # name: test_sensor[2][sensor.cms_sf2000_daily_production-entry] EntityRegistryEntrySnapshot({ 'aliases': set({