Add missing mystrom sensor (#113225)

Co-authored-by: TheJulianJES <TheJulianJES@users.noreply.github.com>
Co-authored-by: Franck Nijhof <frenck@frenck.nl>
pull/113505/head
slyoldfox 2024-03-15 12:05:10 +01:00 committed by GitHub
parent 309f554336
commit ffe9b7801f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 14 additions and 0 deletions

View File

@ -30,6 +30,13 @@ class MyStromSwitchSensorEntityDescription(SensorEntityDescription):
SENSOR_TYPES: tuple[MyStromSwitchSensorEntityDescription, ...] = (
MyStromSwitchSensorEntityDescription(
key="avg_consumption",
translation_key="avg_consumption",
device_class=SensorDeviceClass.POWER,
native_unit_of_measurement=UnitOfPower.WATT,
value_fn=lambda device: device.consumedWs,
),
MyStromSwitchSensorEntityDescription(
key="consumption",
device_class=SensorDeviceClass.POWER,

View File

@ -17,5 +17,12 @@
"abort": {
"already_configured": "[%key:common::config_flow::abort::already_configured_device%]"
}
},
"entity": {
"sensor": {
"avg_consumption": {
"name": "Average consumption"
}
}
}
}