Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 5 additions & 7 deletions homeassistant/components/pvoutput/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,23 +45,23 @@ class PVOutputSensorEntityDescription(
SENSORS: tuple[PVOutputSensorEntityDescription, ...] = (
PVOutputSensorEntityDescription(
key="energy_consumption",
name="Energy consumed",
translation_key="energy_consumption",
native_unit_of_measurement=UnitOfEnergy.WATT_HOUR,
device_class=SensorDeviceClass.ENERGY,
state_class=SensorStateClass.TOTAL_INCREASING,
value_fn=lambda status: status.energy_consumption,
),
PVOutputSensorEntityDescription(
key="energy_generation",
name="Energy generated",
translation_key="energy_generation",
native_unit_of_measurement=UnitOfEnergy.WATT_HOUR,
device_class=SensorDeviceClass.ENERGY,
state_class=SensorStateClass.TOTAL_INCREASING,
value_fn=lambda status: status.energy_generation,
),
PVOutputSensorEntityDescription(
key="normalized_output",
name="Efficiency",
translation_key="efficiency",
native_unit_of_measurement=(
f"{UnitOfEnergy.KILO_WATT_HOUR}/{UnitOfPower.KILO_WATT}"
),
Expand All @@ -70,31 +70,29 @@ class PVOutputSensorEntityDescription(
),
PVOutputSensorEntityDescription(
key="power_consumption",
name="Power consumed",
translation_key="power_consumption",
native_unit_of_measurement=UnitOfPower.WATT,
device_class=SensorDeviceClass.POWER,
state_class=SensorStateClass.MEASUREMENT,
value_fn=lambda status: status.power_consumption,
),
PVOutputSensorEntityDescription(
key="power_generation",
name="Power generated",
translation_key="power_generation",
native_unit_of_measurement=UnitOfPower.WATT,
device_class=SensorDeviceClass.POWER,
state_class=SensorStateClass.MEASUREMENT,
value_fn=lambda status: status.power_generation,
),
PVOutputSensorEntityDescription(
key="temperature",
name="Temperature",
native_unit_of_measurement=UnitOfTemperature.CELSIUS,
device_class=SensorDeviceClass.TEMPERATURE,
state_class=SensorStateClass.MEASUREMENT,
value_fn=lambda status: status.temperature,
),
PVOutputSensorEntityDescription(
key="voltage",
name="Voltage",
native_unit_of_measurement=UnitOfElectricPotential.VOLT,
device_class=SensorDeviceClass.VOLTAGE,
state_class=SensorStateClass.MEASUREMENT,
Expand Down
19 changes: 19 additions & 0 deletions homeassistant/components/pvoutput/strings.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,24 @@
"already_configured": "[%key:common::config_flow::abort::already_configured_device%]",
"reauth_successful": "[%key:common::config_flow::abort::reauth_successful%]"
}
},
"entity": {
"sensor": {
"energy_consumption": {
"name": "Energy consumed"
},
"energy_generation": {
"name": "Energy generated"
},
"efficiency": {
"name": "Efficiency"
},
"power_consumption": {
"name": "Power consumed"
},
"power_generation": {
"name": "Power generated"
}
}
}
}