Use pressure constants in code base (#40262)

This commit is contained in:
springstan authored and GitHub committed 2020-09-19 09:26:08 +02:00
1 parent f563068ce6
commit e330468a13
17 files changed
+56 -30

No files matched your search

+3 -2
View File
@@ -16,6 +16,7 @@ from homeassistant.const import (
CONF_UNIT_SYSTEM_METRIC,
PERCENTAGE,
POWER_WATT,
PRESSURE_HPA,
STATE_UNAVAILABLE,
STATE_UNKNOWN,
TEMP_CELSIUS,
@@ -48,10 +49,10 @@ async def async_test_temperature(hass, cluster, entity_id):
async def async_test_pressure(hass, cluster, entity_id):
"""Test pressure sensor."""
await send_attributes_report(hass, cluster, {1: 1, 0: 1000, 2: 10000})
assert_state(hass, entity_id, "1000", "hPa")
assert_state(hass, entity_id, "1000", PRESSURE_HPA)
await send_attributes_report(hass, cluster, {0: 1000, 20: -1, 16: 10000})
assert_state(hass, entity_id, "1000", "hPa")
assert_state(hass, entity_id, "1000", PRESSURE_HPA)
async def async_test_illuminance(hass, cluster, entity_id):