diff --git a/homeassistant/components/rflink/sensor.py b/homeassistant/components/rflink/sensor.py index baccd47ebb3..b96e03e7eb4 100644 --- a/homeassistant/components/rflink/sensor.py +++ b/homeassistant/components/rflink/sensor.py @@ -20,14 +20,14 @@ from homeassistant.const import ( CONF_SENSOR_TYPE, CONF_UNIT_OF_MEASUREMENT, DEGREE, - ELECTRIC_CURRENT_AMPERE, - ELECTRIC_POTENTIAL_VOLT, LIGHT_LUX, PERCENTAGE, - PRECIPITATION_MILLIMETERS, UV_INDEX, + UnitOfElectricCurrent, + UnitOfElectricPotential, UnitOfLength, UnitOfPower, + UnitOfPrecipitationDepth, UnitOfPressure, UnitOfSpeed, UnitOfTemperature, @@ -91,21 +91,21 @@ SENSOR_TYPES = ( name="Current phase 1", device_class=SensorDeviceClass.CURRENT, state_class=SensorStateClass.MEASUREMENT, - native_unit_of_measurement=ELECTRIC_CURRENT_AMPERE, + native_unit_of_measurement=UnitOfElectricCurrent.AMPERE, ), SensorEntityDescription( key="current_phase_2", name="Current phase 2", device_class=SensorDeviceClass.CURRENT, state_class=SensorStateClass.MEASUREMENT, - native_unit_of_measurement=ELECTRIC_CURRENT_AMPERE, + native_unit_of_measurement=UnitOfElectricCurrent.AMPERE, ), SensorEntityDescription( key="current_phase_3", name="Current phase 3", device_class=SensorDeviceClass.CURRENT, state_class=SensorStateClass.MEASUREMENT, - native_unit_of_measurement=ELECTRIC_CURRENT_AMPERE, + native_unit_of_measurement=UnitOfElectricCurrent.AMPERE, ), SensorEntityDescription( key="distance", @@ -189,7 +189,7 @@ SENSOR_TYPES = ( name="Total rain", device_class=SensorDeviceClass.PRECIPITATION, state_class=SensorStateClass.TOTAL_INCREASING, - native_unit_of_measurement=PRECIPITATION_MILLIMETERS, + native_unit_of_measurement=UnitOfPrecipitationDepth.MILLIMETERS, ), SensorEntityDescription( key="uv_intensity", @@ -208,7 +208,7 @@ SENSOR_TYPES = ( name="Voltage", device_class=SensorDeviceClass.VOLTAGE, state_class=SensorStateClass.MEASUREMENT, - native_unit_of_measurement=ELECTRIC_POTENTIAL_VOLT, + native_unit_of_measurement=UnitOfElectricPotential.VOLT, ), SensorEntityDescription( key="watt",