Skip to content

Commit

Permalink
Add missing mystrom sensor (home-assistant#113225)
Browse files Browse the repository at this point in the history
Co-authored-by: TheJulianJES <TheJulianJES@users.noreply.github.com>
Co-authored-by: Franck Nijhof <frenck@frenck.nl>
  • Loading branch information
3 people authored Mar 15, 2024
1 parent 309f554 commit ffe9b78
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
7 changes: 7 additions & 0 deletions homeassistant/components/mystrom/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
7 changes: 7 additions & 0 deletions homeassistant/components/mystrom/strings.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,12 @@
"abort": {
"already_configured": "[%key:common::config_flow::abort::already_configured_device%]"
}
},
"entity": {
"sensor": {
"avg_consumption": {
"name": "Average consumption"
}
}
}
}

0 comments on commit ffe9b78

Please sign in to comment.