mirror of
https://github.com/home-assistant/core.git
synced 2025-07-18 10:47:10 +00:00
Correct unit of vera power meter sensor (#69285)
This commit is contained in:
parent
ef9cd66320
commit
fe65804de1
@ -11,6 +11,7 @@ from homeassistant.config_entries import ConfigEntry
|
|||||||
from homeassistant.const import (
|
from homeassistant.const import (
|
||||||
LIGHT_LUX,
|
LIGHT_LUX,
|
||||||
PERCENTAGE,
|
PERCENTAGE,
|
||||||
|
POWER_WATT,
|
||||||
TEMP_CELSIUS,
|
TEMP_CELSIUS,
|
||||||
TEMP_FAHRENHEIT,
|
TEMP_FAHRENHEIT,
|
||||||
Platform,
|
Platform,
|
||||||
@ -72,7 +73,7 @@ class VeraSensor(VeraDevice[veraApi.VeraSensor], SensorEntity):
|
|||||||
if self.vera_device.category == veraApi.CATEGORY_HUMIDITY_SENSOR:
|
if self.vera_device.category == veraApi.CATEGORY_HUMIDITY_SENSOR:
|
||||||
return PERCENTAGE
|
return PERCENTAGE
|
||||||
if self.vera_device.category == veraApi.CATEGORY_POWER_METER:
|
if self.vera_device.category == veraApi.CATEGORY_POWER_METER:
|
||||||
return "watts"
|
return POWER_WATT
|
||||||
return None
|
return None
|
||||||
|
|
||||||
def update(self) -> None:
|
def update(self) -> None:
|
||||||
|
@ -135,7 +135,7 @@ async def test_power_meter_sensor(
|
|||||||
category=pv.CATEGORY_POWER_METER,
|
category=pv.CATEGORY_POWER_METER,
|
||||||
class_property="power",
|
class_property="power",
|
||||||
assert_states=(("12", "12"), ("13", "13")),
|
assert_states=(("12", "12"), ("13", "13")),
|
||||||
assert_unit_of_measurement="watts",
|
assert_unit_of_measurement="W",
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user