|
38 | 38 | SENSOR_TYPE_POWER = "power" |
39 | 39 | SENSOR_TYPE_VOLTAGE = "voltage" |
40 | 40 | SENSOR_TYPE_CURRENT = "electricCurrent" |
| 41 | +SENSOR_TYPE_POWER_CONSUMPTION = "weight" |
41 | 42 | SENSOR_TYPE_USED_ELECTRICITY = "usedElectricity" |
42 | 43 | SENSOR_TYPE_LIGHTLEVEL = "lightLevel" |
43 | 44 |
|
@@ -120,6 +121,13 @@ class SwitchbotCloudSensorEntityDescription(SensorEntityDescription): |
120 | 121 | native_unit_of_measurement=CONCENTRATION_PARTS_PER_MILLION, |
121 | 122 | ) |
122 | 123 |
|
| 124 | +POWER_CONSUMPTION_DESCRIPTION = SensorEntityDescription( |
| 125 | + key=SENSOR_TYPE_POWER_CONSUMPTION, |
| 126 | + device_class=SensorDeviceClass.POWER, |
| 127 | + state_class=SensorStateClass.MEASUREMENT, |
| 128 | + native_unit_of_measurement=UnitOfPower.WATT, |
| 129 | +) |
| 130 | + |
123 | 131 | RELAY_SWITCH_2PM_POWER_DESCRIPTION = SensorEntityDescription( |
124 | 132 | key=RELAY_SWITCH_2PM_SENSOR_TYPE_POWER, |
125 | 133 | device_class=SensorDeviceClass.POWER, |
@@ -180,10 +188,12 @@ class SwitchbotCloudSensorEntityDescription(SensorEntityDescription): |
180 | 188 | "Plug Mini (US)": ( |
181 | 189 | VOLTAGE_DESCRIPTION, |
182 | 190 | CURRENT_DESCRIPTION_IN_MA, |
| 191 | + POWER_CONSUMPTION_DESCRIPTION, |
183 | 192 | ), |
184 | 193 | "Plug Mini (JP)": ( |
185 | 194 | VOLTAGE_DESCRIPTION, |
186 | 195 | CURRENT_DESCRIPTION_IN_MA, |
| 196 | + POWER_CONSUMPTION_DESCRIPTION, |
187 | 197 | ), |
188 | 198 | "Plug Mini (EU)": ( |
189 | 199 | POWER_DESCRIPTION, |
|
0 commit comments