diff --git a/homeassistant/components/homekit_controller/sensor.py b/homeassistant/components/homekit_controller/sensor.py index eb5b99e126d..ebfba110e48 100644 --- a/homeassistant/components/homekit_controller/sensor.py +++ b/homeassistant/components/homekit_controller/sensor.py @@ -164,7 +164,7 @@ SIMPLE_SENSOR: dict[str, HomeKitSensorEntityDescription] = { key=CharacteristicsTypes.VENDOR_CONNECTSENSE_ENERGY_KW_HOUR, name="Energy kWh", device_class=SensorDeviceClass.ENERGY, - state_class=SensorStateClass.MEASUREMENT, + state_class=SensorStateClass.TOTAL_INCREASING, native_unit_of_measurement=UnitOfEnergy.KILO_WATT_HOUR, ), CharacteristicsTypes.VENDOR_EVE_ENERGY_WATT: HomeKitSensorEntityDescription( diff --git a/tests/components/homekit_controller/snapshots/test_init.ambr b/tests/components/homekit_controller/snapshots/test_init.ambr index 2f38229aef8..476ab390217 100644 --- a/tests/components/homekit_controller/snapshots/test_init.ambr +++ b/tests/components/homekit_controller/snapshots/test_init.ambr @@ -2477,7 +2477,7 @@ ]), 'area_id': None, 'capabilities': dict({ - 'state_class': , + 'state_class': , }), 'config_entry_id': 'TestData', 'device_class': None, @@ -2505,7 +2505,7 @@ 'attributes': dict({ 'device_class': 'energy', 'friendly_name': 'InWall Outlet-0394DE Energy kWh', - 'state_class': , + 'state_class': , 'unit_of_measurement': , }), 'entity_id': 'sensor.inwall_outlet_0394de_energy_kwh', @@ -2518,7 +2518,7 @@ ]), 'area_id': None, 'capabilities': dict({ - 'state_class': , + 'state_class': , }), 'config_entry_id': 'TestData', 'device_class': None, @@ -2546,7 +2546,7 @@ 'attributes': dict({ 'device_class': 'energy', 'friendly_name': 'InWall Outlet-0394DE Energy kWh', - 'state_class': , + 'state_class': , 'unit_of_measurement': , }), 'entity_id': 'sensor.inwall_outlet_0394de_energy_kwh_2', diff --git a/tests/components/homekit_controller/specific_devices/test_connectsense.py b/tests/components/homekit_controller/specific_devices/test_connectsense.py index 9e08c6fed0a..94a91bb0417 100644 --- a/tests/components/homekit_controller/specific_devices/test_connectsense.py +++ b/tests/components/homekit_controller/specific_devices/test_connectsense.py @@ -50,7 +50,7 @@ async def test_connectsense_setup(hass: HomeAssistant) -> None: entity_id="sensor.inwall_outlet_0394de_energy_kwh", friendly_name="InWall Outlet-0394DE Energy kWh", unique_id="00:00:00:00:00:00_1_13_20", - capabilities={"state_class": SensorStateClass.MEASUREMENT}, + capabilities={"state_class": SensorStateClass.TOTAL_INCREASING}, unit_of_measurement=UnitOfEnergy.KILO_WATT_HOUR, state="379.69299", ), @@ -80,7 +80,7 @@ async def test_connectsense_setup(hass: HomeAssistant) -> None: entity_id="sensor.inwall_outlet_0394de_energy_kwh_2", friendly_name="InWall Outlet-0394DE Energy kWh", unique_id="00:00:00:00:00:00_1_25_32", - capabilities={"state_class": SensorStateClass.MEASUREMENT}, + capabilities={"state_class": SensorStateClass.TOTAL_INCREASING}, unit_of_measurement=UnitOfEnergy.KILO_WATT_HOUR, state="175.85001", ), @@ -129,7 +129,7 @@ async def test_connectsense_setup(hass: HomeAssistant) -> None: entity_id="sensor.inwall_outlet_0394de_energy_kwh", friendly_name="InWall Outlet-0394DE Energy kWh", unique_id="00:00:00:00:00:00_1_13_20", - capabilities={"state_class": SensorStateClass.MEASUREMENT}, + capabilities={"state_class": SensorStateClass.TOTAL_INCREASING}, unit_of_measurement=UnitOfEnergy.KILO_WATT_HOUR, state="379.69299", ), @@ -159,7 +159,7 @@ async def test_connectsense_setup(hass: HomeAssistant) -> None: entity_id="sensor.inwall_outlet_0394de_energy_kwh_2", friendly_name="InWall Outlet-0394DE Energy kWh", unique_id="00:00:00:00:00:00_1_25_32", - capabilities={"state_class": SensorStateClass.MEASUREMENT}, + capabilities={"state_class": SensorStateClass.TOTAL_INCREASING}, unit_of_measurement=UnitOfEnergy.KILO_WATT_HOUR, state="175.85001", ),