Round Awair sensor values (#24093)
* Round sensor values * Add code owner * Update code owners * Fix testspull/24250/head
parent
276ab191b5
commit
278b9d0f71
|
@ -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
|
||||
|
|
|
@ -6,5 +6,7 @@
|
|||
"python_awair==0.0.4"
|
||||
],
|
||||
"dependencies": [],
|
||||
"codeowners": []
|
||||
"codeowners": [
|
||||
"@danielsjf"
|
||||
]
|
||||
}
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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"
|
||||
|
|
Loading…
Reference in New Issue