diff --git a/CODEOWNERS b/CODEOWNERS index 307d9ebc068..4bfe0c34272 100644 --- a/CODEOWNERS +++ b/CODEOWNERS @@ -30,6 +30,7 @@ homeassistant/components/asuswrt/* @kennedyshead homeassistant/components/auth/* @home-assistant/core homeassistant/components/automatic/* @armills homeassistant/components/automation/* @home-assistant/core +homeassistant/components/awair/* @danielsjf homeassistant/components/aws/* @awarecan @robbiet480 homeassistant/components/axis/* @kane610 homeassistant/components/azure_event_hub/* @eavanvalkenburg diff --git a/homeassistant/components/awair/manifest.json b/homeassistant/components/awair/manifest.json index cba11e8be1c..dfa5bec3c00 100644 --- a/homeassistant/components/awair/manifest.json +++ b/homeassistant/components/awair/manifest.json @@ -6,5 +6,7 @@ "python_awair==0.0.4" ], "dependencies": [], - "codeowners": [] + "codeowners": [ + "@danielsjf" + ] } diff --git a/homeassistant/components/awair/sensor.py b/homeassistant/components/awair/sensor.py index 85f18e87d13..71b74c7971e 100644 --- a/homeassistant/components/awair/sensor.py +++ b/homeassistant/components/awair/sensor.py @@ -219,6 +219,6 @@ class AwairData: # The air_data_latest call only returns one item, so this should # be safe to only process one entry. for sensor in resp[0][ATTR_SENSORS]: - self.data[sensor[ATTR_COMPONENT]] = sensor[ATTR_VALUE] + self.data[sensor[ATTR_COMPONENT]] = round(sensor[ATTR_VALUE], 1) _LOGGER.debug("Got Awair Data for %s: %s", self._uuid, self.data) diff --git a/tests/components/awair/test_sensor.py b/tests/components/awair/test_sensor.py index d251e8fdce8..d5bb8236a1e 100644 --- a/tests/components/awair/test_sensor.py +++ b/tests/components/awair/test_sensor.py @@ -178,7 +178,7 @@ async def test_awair_humid(hass): await setup_awair(hass) sensor = hass.states.get("sensor.awair_humidity") - assert sensor.state == "32.73" + assert sensor.state == "32.7" assert sensor.attributes["device_class"] == DEVICE_CLASS_HUMIDITY assert sensor.attributes["unit_of_measurement"] == "%" @@ -291,7 +291,7 @@ async def test_async_update(hass): assert score_sensor.state == "79" assert hass.states.get("sensor.awair_temperature").state == "23.4" - assert hass.states.get("sensor.awair_humidity").state == "33.73" + assert hass.states.get("sensor.awair_humidity").state == "33.7" assert hass.states.get("sensor.awair_co2").state == "613" assert hass.states.get("sensor.awair_voc").state == "1013" assert hass.states.get("sensor.awair_pm2_5").state == "7.2"