1
0
mirror of https://github.com/home-assistant/core.git synced 2026-04-30 21:51:29 +01:00

Migrates tests to use UnitOfPressure enum (#86785)

This commit is contained in:
Franck Nijhof
2023-01-27 12:13:27 +01:00
committed by GitHub
parent 561fc2d771
commit 89c0b27b42
4 changed files with 83 additions and 92 deletions

View File

@@ -17,9 +17,9 @@ from homeassistant.const import (
PERCENTAGE,
POWER_VOLT_AMPERE,
POWER_VOLT_AMPERE_REACTIVE,
PRESSURE_HPA,
SIGNAL_STRENGTH_DECIBELS,
VOLUME_CUBIC_METERS,
UnitOfPressure,
)
from tests.common import MockEntity
@@ -44,7 +44,7 @@ UNITS_OF_MEASUREMENT = {
SensorDeviceClass.SIGNAL_STRENGTH: SIGNAL_STRENGTH_DECIBELS, # signal strength (dB/dBm)
SensorDeviceClass.SULPHUR_DIOXIDE: CONCENTRATION_MICROGRAMS_PER_CUBIC_METER, # µg/m³ of sulphur dioxide
SensorDeviceClass.TEMPERATURE: "C", # temperature (C/F)
SensorDeviceClass.PRESSURE: PRESSURE_HPA, # pressure (hPa/mbar)
SensorDeviceClass.PRESSURE: UnitOfPressure.HPA, # pressure (hPa/mbar)
SensorDeviceClass.POWER: "kW", # power (W/kW)
SensorDeviceClass.CURRENT: "A", # current (A)
SensorDeviceClass.ENERGY: "kWh", # energy (Wh/kWh/MWh)