mirror of
https://github.com/home-assistant/core.git
synced 2025-12-24 12:59:34 +00:00
Drop UNIT_ prefix for percentage constant (#39383)
This commit is contained in:
@@ -17,11 +17,11 @@ from homeassistant.const import (
|
||||
ATTR_UNIT_OF_MEASUREMENT,
|
||||
DEVICE_CLASS_TEMPERATURE,
|
||||
LENGTH_METERS,
|
||||
PERCENTAGE,
|
||||
SPEED_KILOMETERS_PER_HOUR,
|
||||
STATE_UNAVAILABLE,
|
||||
TEMP_CELSIUS,
|
||||
TIME_HOURS,
|
||||
UNIT_PERCENTAGE,
|
||||
UV_INDEX,
|
||||
)
|
||||
from homeassistant.setup import async_setup_component
|
||||
@@ -136,7 +136,7 @@ async def test_sensor_with_forecast(hass):
|
||||
assert state.state == "40"
|
||||
assert state.attributes.get(ATTR_ATTRIBUTION) == ATTRIBUTION
|
||||
assert state.attributes.get(ATTR_ICON) == "mdi:weather-lightning"
|
||||
assert state.attributes.get(ATTR_UNIT_OF_MEASUREMENT) == UNIT_PERCENTAGE
|
||||
assert state.attributes.get(ATTR_UNIT_OF_MEASUREMENT) == PERCENTAGE
|
||||
|
||||
entry = registry.async_get("sensor.home_thunderstorm_probability_day_0d")
|
||||
assert entry
|
||||
@@ -147,7 +147,7 @@ async def test_sensor_with_forecast(hass):
|
||||
assert state.state == "40"
|
||||
assert state.attributes.get(ATTR_ATTRIBUTION) == ATTRIBUTION
|
||||
assert state.attributes.get(ATTR_ICON) == "mdi:weather-lightning"
|
||||
assert state.attributes.get(ATTR_UNIT_OF_MEASUREMENT) == UNIT_PERCENTAGE
|
||||
assert state.attributes.get(ATTR_UNIT_OF_MEASUREMENT) == PERCENTAGE
|
||||
|
||||
entry = registry.async_get("sensor.home_thunderstorm_probability_night_0d")
|
||||
assert entry
|
||||
@@ -334,7 +334,7 @@ async def test_sensor_enabled_without_forecast(hass):
|
||||
assert state
|
||||
assert state.state == "10"
|
||||
assert state.attributes.get(ATTR_ATTRIBUTION) == ATTRIBUTION
|
||||
assert state.attributes.get(ATTR_UNIT_OF_MEASUREMENT) == UNIT_PERCENTAGE
|
||||
assert state.attributes.get(ATTR_UNIT_OF_MEASUREMENT) == PERCENTAGE
|
||||
assert state.attributes.get(ATTR_ICON) == "mdi:weather-cloudy"
|
||||
|
||||
entry = registry.async_get("sensor.home_cloud_cover")
|
||||
@@ -400,7 +400,7 @@ async def test_sensor_enabled_without_forecast(hass):
|
||||
assert state
|
||||
assert state.state == "58"
|
||||
assert state.attributes.get(ATTR_ATTRIBUTION) == ATTRIBUTION
|
||||
assert state.attributes.get(ATTR_UNIT_OF_MEASUREMENT) == UNIT_PERCENTAGE
|
||||
assert state.attributes.get(ATTR_UNIT_OF_MEASUREMENT) == PERCENTAGE
|
||||
assert state.attributes.get(ATTR_ICON) == "mdi:weather-cloudy"
|
||||
|
||||
entry = registry.async_get("sensor.home_cloud_cover_day_0d")
|
||||
@@ -411,7 +411,7 @@ async def test_sensor_enabled_without_forecast(hass):
|
||||
assert state
|
||||
assert state.state == "65"
|
||||
assert state.attributes.get(ATTR_ATTRIBUTION) == ATTRIBUTION
|
||||
assert state.attributes.get(ATTR_UNIT_OF_MEASUREMENT) == UNIT_PERCENTAGE
|
||||
assert state.attributes.get(ATTR_UNIT_OF_MEASUREMENT) == PERCENTAGE
|
||||
assert state.attributes.get(ATTR_ICON) == "mdi:weather-cloudy"
|
||||
|
||||
entry = registry.async_get("sensor.home_cloud_cover_night_0d")
|
||||
|
||||
Reference in New Issue
Block a user