From 49181d6ba8bc1fb4d9160947c78589a9f11d4355 Mon Sep 17 00:00:00 2001 From: apaperclip <67401560+apaperclip@users.noreply.github.com> Date: Thu, 8 Jul 2021 12:10:05 -0400 Subject: [PATCH] Remove scale calculation for climacell cloud cover (#52752) --- homeassistant/components/climacell/const.py | 1 - homeassistant/components/climacell/weather.py | 2 -- tests/components/climacell/test_sensor.py | 2 +- tests/components/climacell/test_weather.py | 4 ++-- 4 files changed, 3 insertions(+), 6 deletions(-) diff --git a/homeassistant/components/climacell/const.py b/homeassistant/components/climacell/const.py index 062de93375b..057cef5e993 100644 --- a/homeassistant/components/climacell/const.py +++ b/homeassistant/components/climacell/const.py @@ -214,7 +214,6 @@ CC_SENSOR_TYPES = [ ATTR_FIELD: CC_ATTR_CLOUD_COVER, ATTR_NAME: "Cloud Cover", CONF_UNIT_OF_MEASUREMENT: PERCENTAGE, - ATTR_SCALE: 1 / 100, }, { ATTR_FIELD: CC_ATTR_WIND_GUST, diff --git a/homeassistant/components/climacell/weather.py b/homeassistant/components/climacell/weather.py index 1b3b50e8566..be03b53ef72 100644 --- a/homeassistant/components/climacell/weather.py +++ b/homeassistant/components/climacell/weather.py @@ -207,8 +207,6 @@ class BaseClimaCellWeatherEntity(ClimaCellEntity, WeatherEntity): distance_convert(self.wind_gust, LENGTH_MILES, LENGTH_KILOMETERS), 4 ) cloud_cover = self.cloud_cover - if cloud_cover is not None: - cloud_cover /= 100 return { ATTR_CLOUD_COVER: cloud_cover, ATTR_WIND_GUST: wind_gust, diff --git a/tests/components/climacell/test_sensor.py b/tests/components/climacell/test_sensor.py index d93bdb5fae8..c642457b63e 100644 --- a/tests/components/climacell/test_sensor.py +++ b/tests/components/climacell/test_sensor.py @@ -182,7 +182,7 @@ async def test_v4_sensor( check_sensor_state(hass, PRESSURE_SURFACE_LEVEL, "997.9688") check_sensor_state(hass, GHI, "0.0") check_sensor_state(hass, CLOUD_BASE, "1.1909") - check_sensor_state(hass, CLOUD_COVER, "1.0") + check_sensor_state(hass, CLOUD_COVER, "100") check_sensor_state(hass, CLOUD_CEILING, "1.1909") check_sensor_state(hass, WIND_GUST, "5.6506") check_sensor_state(hass, PRECIPITATION_TYPE, "rain") diff --git a/tests/components/climacell/test_weather.py b/tests/components/climacell/test_weather.py index fa1ef9dc490..90efdea3c8c 100644 --- a/tests/components/climacell/test_weather.py +++ b/tests/components/climacell/test_weather.py @@ -228,7 +228,7 @@ async def test_v3_weather( assert weather_state.attributes[ATTR_WEATHER_VISIBILITY] == 9.9940 assert weather_state.attributes[ATTR_WEATHER_WIND_BEARING] == 320.31 assert weather_state.attributes[ATTR_WEATHER_WIND_SPEED] == 14.6289 - assert weather_state.attributes[ATTR_CLOUD_COVER] == 1 + assert weather_state.attributes[ATTR_CLOUD_COVER] == 100 assert weather_state.attributes[ATTR_WIND_GUST] == 24.0758 assert weather_state.attributes[ATTR_PRECIPITATION_TYPE] == "rain" @@ -391,6 +391,6 @@ async def test_v4_weather( assert weather_state.attributes[ATTR_WEATHER_VISIBILITY] == 13.1162 assert weather_state.attributes[ATTR_WEATHER_WIND_BEARING] == 315.14 assert weather_state.attributes[ATTR_WEATHER_WIND_SPEED] == 15.0152 - assert weather_state.attributes[ATTR_CLOUD_COVER] == 1 + assert weather_state.attributes[ATTR_CLOUD_COVER] == 100 assert weather_state.attributes[ATTR_WIND_GUST] == 20.3421 assert weather_state.attributes[ATTR_PRECIPITATION_TYPE] == "rain"