mirror of
https://github.com/home-assistant/core.git
synced 2025-07-23 21:27:38 +00:00
Change the suggested energy units to kWh (#109184)
* Change the suggested energy units to kWh since the practical value is pretty large. * Fix unit tests
This commit is contained in:
parent
b8c9da4705
commit
961a1c4d00
@ -128,6 +128,7 @@ WALL_CONNECTOR_SENSORS = [
|
||||
WallConnectorSensorDescription(
|
||||
key="energy_kWh",
|
||||
native_unit_of_measurement=UnitOfEnergy.WATT_HOUR,
|
||||
suggested_unit_of_measurement=UnitOfEnergy.KILO_WATT_HOUR,
|
||||
value_fn=lambda data: data[WALLCONNECTOR_DATA_LIFETIME].energy_wh,
|
||||
device_class=SensorDeviceClass.ENERGY,
|
||||
state_class=SensorStateClass.TOTAL_INCREASING,
|
||||
|
@ -24,7 +24,7 @@ async def test_sensors(hass: HomeAssistant) -> None:
|
||||
"sensor.tesla_wall_connector_grid_frequency", "50.021", "49.981"
|
||||
),
|
||||
EntityAndExpectedValues(
|
||||
"sensor.tesla_wall_connector_energy", "988022", "989000"
|
||||
"sensor.tesla_wall_connector_energy", "988.022", "989.000"
|
||||
),
|
||||
EntityAndExpectedValues(
|
||||
"sensor.tesla_wall_connector_phase_a_current", "10", "7"
|
||||
|
Loading…
x
Reference in New Issue
Block a user