Correct unit of vera power meter sensor (#69285)
This commit is contained in:
parent
ef9cd66320
commit
fe65804de1
2 changed files with 3 additions and 2 deletions
|
@ -11,6 +11,7 @@ from homeassistant.config_entries import ConfigEntry
|
|||
from homeassistant.const import (
|
||||
LIGHT_LUX,
|
||||
PERCENTAGE,
|
||||
POWER_WATT,
|
||||
TEMP_CELSIUS,
|
||||
TEMP_FAHRENHEIT,
|
||||
Platform,
|
||||
|
@ -72,7 +73,7 @@ class VeraSensor(VeraDevice[veraApi.VeraSensor], SensorEntity):
|
|||
if self.vera_device.category == veraApi.CATEGORY_HUMIDITY_SENSOR:
|
||||
return PERCENTAGE
|
||||
if self.vera_device.category == veraApi.CATEGORY_POWER_METER:
|
||||
return "watts"
|
||||
return POWER_WATT
|
||||
return None
|
||||
|
||||
def update(self) -> None:
|
||||
|
|
|
@ -135,7 +135,7 @@ async def test_power_meter_sensor(
|
|||
category=pv.CATEGORY_POWER_METER,
|
||||
class_property="power",
|
||||
assert_states=(("12", "12"), ("13", "13")),
|
||||
assert_unit_of_measurement="watts",
|
||||
assert_unit_of_measurement="W",
|
||||
)
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue