mirror of
https://github.com/home-assistant/core.git
synced 2025-07-10 14:57:09 +00:00
Use right state class for kWh sensor in homekit_controller
(#107644)
This commit is contained in:
parent
4dbaa576a7
commit
c62e79f9ee
@ -164,7 +164,7 @@ SIMPLE_SENSOR: dict[str, HomeKitSensorEntityDescription] = {
|
|||||||
key=CharacteristicsTypes.VENDOR_CONNECTSENSE_ENERGY_KW_HOUR,
|
key=CharacteristicsTypes.VENDOR_CONNECTSENSE_ENERGY_KW_HOUR,
|
||||||
name="Energy kWh",
|
name="Energy kWh",
|
||||||
device_class=SensorDeviceClass.ENERGY,
|
device_class=SensorDeviceClass.ENERGY,
|
||||||
state_class=SensorStateClass.MEASUREMENT,
|
state_class=SensorStateClass.TOTAL_INCREASING,
|
||||||
native_unit_of_measurement=UnitOfEnergy.KILO_WATT_HOUR,
|
native_unit_of_measurement=UnitOfEnergy.KILO_WATT_HOUR,
|
||||||
),
|
),
|
||||||
CharacteristicsTypes.VENDOR_EVE_ENERGY_WATT: HomeKitSensorEntityDescription(
|
CharacteristicsTypes.VENDOR_EVE_ENERGY_WATT: HomeKitSensorEntityDescription(
|
||||||
|
@ -2477,7 +2477,7 @@
|
|||||||
]),
|
]),
|
||||||
'area_id': None,
|
'area_id': None,
|
||||||
'capabilities': dict({
|
'capabilities': dict({
|
||||||
'state_class': <SensorStateClass.MEASUREMENT: 'measurement'>,
|
'state_class': <SensorStateClass.TOTAL_INCREASING: 'total_increasing'>,
|
||||||
}),
|
}),
|
||||||
'config_entry_id': 'TestData',
|
'config_entry_id': 'TestData',
|
||||||
'device_class': None,
|
'device_class': None,
|
||||||
@ -2505,7 +2505,7 @@
|
|||||||
'attributes': dict({
|
'attributes': dict({
|
||||||
'device_class': 'energy',
|
'device_class': 'energy',
|
||||||
'friendly_name': 'InWall Outlet-0394DE Energy kWh',
|
'friendly_name': 'InWall Outlet-0394DE Energy kWh',
|
||||||
'state_class': <SensorStateClass.MEASUREMENT: 'measurement'>,
|
'state_class': <SensorStateClass.TOTAL_INCREASING: 'total_increasing'>,
|
||||||
'unit_of_measurement': <UnitOfEnergy.KILO_WATT_HOUR: 'kWh'>,
|
'unit_of_measurement': <UnitOfEnergy.KILO_WATT_HOUR: 'kWh'>,
|
||||||
}),
|
}),
|
||||||
'entity_id': 'sensor.inwall_outlet_0394de_energy_kwh',
|
'entity_id': 'sensor.inwall_outlet_0394de_energy_kwh',
|
||||||
@ -2518,7 +2518,7 @@
|
|||||||
]),
|
]),
|
||||||
'area_id': None,
|
'area_id': None,
|
||||||
'capabilities': dict({
|
'capabilities': dict({
|
||||||
'state_class': <SensorStateClass.MEASUREMENT: 'measurement'>,
|
'state_class': <SensorStateClass.TOTAL_INCREASING: 'total_increasing'>,
|
||||||
}),
|
}),
|
||||||
'config_entry_id': 'TestData',
|
'config_entry_id': 'TestData',
|
||||||
'device_class': None,
|
'device_class': None,
|
||||||
@ -2546,7 +2546,7 @@
|
|||||||
'attributes': dict({
|
'attributes': dict({
|
||||||
'device_class': 'energy',
|
'device_class': 'energy',
|
||||||
'friendly_name': 'InWall Outlet-0394DE Energy kWh',
|
'friendly_name': 'InWall Outlet-0394DE Energy kWh',
|
||||||
'state_class': <SensorStateClass.MEASUREMENT: 'measurement'>,
|
'state_class': <SensorStateClass.TOTAL_INCREASING: 'total_increasing'>,
|
||||||
'unit_of_measurement': <UnitOfEnergy.KILO_WATT_HOUR: 'kWh'>,
|
'unit_of_measurement': <UnitOfEnergy.KILO_WATT_HOUR: 'kWh'>,
|
||||||
}),
|
}),
|
||||||
'entity_id': 'sensor.inwall_outlet_0394de_energy_kwh_2',
|
'entity_id': 'sensor.inwall_outlet_0394de_energy_kwh_2',
|
||||||
|
@ -50,7 +50,7 @@ async def test_connectsense_setup(hass: HomeAssistant) -> None:
|
|||||||
entity_id="sensor.inwall_outlet_0394de_energy_kwh",
|
entity_id="sensor.inwall_outlet_0394de_energy_kwh",
|
||||||
friendly_name="InWall Outlet-0394DE Energy kWh",
|
friendly_name="InWall Outlet-0394DE Energy kWh",
|
||||||
unique_id="00:00:00:00:00:00_1_13_20",
|
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,
|
unit_of_measurement=UnitOfEnergy.KILO_WATT_HOUR,
|
||||||
state="379.69299",
|
state="379.69299",
|
||||||
),
|
),
|
||||||
@ -80,7 +80,7 @@ async def test_connectsense_setup(hass: HomeAssistant) -> None:
|
|||||||
entity_id="sensor.inwall_outlet_0394de_energy_kwh_2",
|
entity_id="sensor.inwall_outlet_0394de_energy_kwh_2",
|
||||||
friendly_name="InWall Outlet-0394DE Energy kWh",
|
friendly_name="InWall Outlet-0394DE Energy kWh",
|
||||||
unique_id="00:00:00:00:00:00_1_25_32",
|
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,
|
unit_of_measurement=UnitOfEnergy.KILO_WATT_HOUR,
|
||||||
state="175.85001",
|
state="175.85001",
|
||||||
),
|
),
|
||||||
@ -129,7 +129,7 @@ async def test_connectsense_setup(hass: HomeAssistant) -> None:
|
|||||||
entity_id="sensor.inwall_outlet_0394de_energy_kwh",
|
entity_id="sensor.inwall_outlet_0394de_energy_kwh",
|
||||||
friendly_name="InWall Outlet-0394DE Energy kWh",
|
friendly_name="InWall Outlet-0394DE Energy kWh",
|
||||||
unique_id="00:00:00:00:00:00_1_13_20",
|
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,
|
unit_of_measurement=UnitOfEnergy.KILO_WATT_HOUR,
|
||||||
state="379.69299",
|
state="379.69299",
|
||||||
),
|
),
|
||||||
@ -159,7 +159,7 @@ async def test_connectsense_setup(hass: HomeAssistant) -> None:
|
|||||||
entity_id="sensor.inwall_outlet_0394de_energy_kwh_2",
|
entity_id="sensor.inwall_outlet_0394de_energy_kwh_2",
|
||||||
friendly_name="InWall Outlet-0394DE Energy kWh",
|
friendly_name="InWall Outlet-0394DE Energy kWh",
|
||||||
unique_id="00:00:00:00:00:00_1_25_32",
|
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,
|
unit_of_measurement=UnitOfEnergy.KILO_WATT_HOUR,
|
||||||
state="175.85001",
|
state="175.85001",
|
||||||
),
|
),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user