diff --git a/homeassistant/components/indevolt/const.py b/homeassistant/components/indevolt/const.py index 6d6dd840345..c5d8d5b748a 100644 --- a/homeassistant/components/indevolt/const.py +++ b/homeassistant/components/indevolt/const.py @@ -32,6 +32,7 @@ SENSOR_KEYS: Final[dict[int, list[str]]] = { IndevoltSystem.OFF_GRID_OUTPUT_ENERGY, IndevoltSystem.BYPASS_POWER, IndevoltSystem.BYPASS_INPUT_ENERGY, + IndevoltBattery.RATED_CAPACITY, IndevoltBattery.DAILY_CHARGING_ENERGY, IndevoltBattery.DAILY_DISCHARGING_ENERGY, IndevoltBattery.TOTAL_CHARGING_ENERGY, @@ -78,7 +79,7 @@ SENSOR_KEYS: Final[dict[int, list[str]]] = { IndevoltSolar.DC_INPUT_POWER_2, IndevoltSolar.DC_INPUT_POWER_3, IndevoltSolar.DC_INPUT_POWER_4, - IndevoltBattery.RATED_CAPACITY_GEN2, + IndevoltBattery.RATED_CAPACITY, IndevoltSystem.BYPASS_POWER, IndevoltSystem.TOTAL_OUTPUT_ENERGY, IndevoltSystem.OFF_GRID_OUTPUT_ENERGY, diff --git a/homeassistant/components/indevolt/sensor.py b/homeassistant/components/indevolt/sensor.py index bef3ac0d3e5..eb637919193 100644 --- a/homeassistant/components/indevolt/sensor.py +++ b/homeassistant/components/indevolt/sensor.py @@ -73,12 +73,10 @@ SENSORS: Final = ( device_class=SensorDeviceClass.ENUM, ), IndevoltSensorEntityDescription( - key=IndevoltBattery.RATED_CAPACITY_GEN2, - generation=(2,), + key=IndevoltBattery.RATED_CAPACITY, translation_key="rated_capacity", native_unit_of_measurement=UnitOfEnergy.KILO_WATT_HOUR, device_class=SensorDeviceClass.ENERGY, - state_class=SensorStateClass.TOTAL_INCREASING, ), IndevoltSensorEntityDescription( key=IndevoltConfig.READ_DISCHARGE_LIMIT, diff --git a/tests/components/indevolt/snapshots/test_diagnostics.ambr b/tests/components/indevolt/snapshots/test_diagnostics.ambr index ae2671391d7..1e7a2cc4c9f 100644 --- a/tests/components/indevolt/snapshots/test_diagnostics.ambr +++ b/tests/components/indevolt/snapshots/test_diagnostics.ambr @@ -3,6 +3,7 @@ dict({ 'coordinator_data': dict({ '11034': 0, + '142': 1.64, '1501': 0, '1502': 0, '1505': 553673, diff --git a/tests/components/indevolt/snapshots/test_sensor.ambr b/tests/components/indevolt/snapshots/test_sensor.ambr index 2a13ed8b1d8..b4e05c9bcd5 100644 --- a/tests/components/indevolt/snapshots/test_sensor.ambr +++ b/tests/components/indevolt/snapshots/test_sensor.ambr @@ -1804,6 +1804,61 @@ 'state': '0', }) # --- +# name: test_sensor[1][sensor.bk1600_rated_capacity-entry] + EntityRegistryEntrySnapshot({ + 'aliases': list([ + None, + ]), + 'area_id': None, + 'capabilities': None, + 'config_entry_id': , + 'config_subentry_id': , + 'device_class': None, + 'device_id': , + 'disabled_by': None, + 'domain': 'sensor', + 'entity_category': None, + 'entity_id': 'sensor.bk1600_rated_capacity', + 'has_entity_name': True, + 'hidden_by': None, + 'icon': None, + 'id': , + 'labels': set({ + }), + 'name': None, + 'object_id_base': 'Rated capacity', + 'options': dict({ + 'sensor': dict({ + 'suggested_display_precision': 2, + }), + }), + 'original_device_class': , + 'original_icon': None, + 'original_name': 'Rated capacity', + 'platform': 'indevolt', + 'previous_unique_id': None, + 'suggested_object_id': None, + 'supported_features': 0, + 'translation_key': 'rated_capacity', + 'unique_id': 'BK1600-12345678_142', + 'unit_of_measurement': , + }) +# --- +# name: test_sensor[1][sensor.bk1600_rated_capacity-state] + StateSnapshot({ + 'attributes': ReadOnlyDict({ + 'device_class': 'energy', + 'friendly_name': 'BK1600 Rated capacity', + 'unit_of_measurement': , + }), + 'context': , + 'entity_id': 'sensor.bk1600_rated_capacity', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': '1.64', + }) +# --- # name: test_sensor[1][sensor.bk1600_real_time_mode-entry] EntityRegistryEntrySnapshot({ 'aliases': list([ @@ -6360,9 +6415,7 @@ None, ]), 'area_id': None, - 'capabilities': dict({ - 'state_class': , - }), + 'capabilities': None, 'config_entry_id': , 'config_subentry_id': , 'device_class': None, @@ -6401,7 +6454,6 @@ 'attributes': ReadOnlyDict({ 'device_class': 'energy', 'friendly_name': 'CMS-SF2000 Rated capacity', - 'state_class': , 'unit_of_measurement': , }), 'context': ,