Add and use more unit constants (#32122)

* Add and use speed constants

* Add and use meter based volume and area constants

* Add and use more mass unit constants

* Add and use concentration unit constants

* Add and use watts per square meter constant

* Use more time constants

* Use more data constants
This commit is contained in:
Ville Skyttä authored and GitHub committed 2020-02-24 17:52:14 -08:00
1 parent c98f50115d
commit 496bd3dddf
44 files changed
+422 -177

No files matched your search

+2 -2
View File
@@ -4,7 +4,7 @@ from unittest.mock import DEFAULT, Mock, patch
import homeassistant.components.mhz19.sensor as mhz19
from homeassistant.components.sensor import DOMAIN
from homeassistant.const import TEMP_FAHRENHEIT
from homeassistant.const import CONCENTRATION_PARTS_PER_MILLION, TEMP_FAHRENHEIT
from homeassistant.setup import setup_component
from tests.common import assert_setup_component, get_test_home_assistant
@@ -100,7 +100,7 @@ class TestMHZ19Sensor(unittest.TestCase):
assert "name: CO2" == sensor.name
assert 1000 == sensor.state
assert "ppm" == sensor.unit_of_measurement
assert CONCENTRATION_PARTS_PER_MILLION == sensor.unit_of_measurement
assert sensor.should_poll
assert {"temperature": 24} == sensor.device_state_attributes