1
0
mirror of https://github.com/home-assistant/core.git synced 2025-12-24 12:59:34 +00:00

Use more state attribute name constants (#40428)

This commit is contained in:
Ville Skyttä
2020-09-22 00:03:39 +03:00
committed by GitHub
parent f78391ce2a
commit 5e90a4d000
36 changed files with 231 additions and 156 deletions

View File

@@ -5,7 +5,7 @@ from unittest.mock import patch
import pytest
from homeassistant.components.spaceapi import DOMAIN, SPACEAPI_VERSION, URL_API_SPACEAPI
from homeassistant.const import PERCENTAGE, TEMP_CELSIUS
from homeassistant.const import ATTR_UNIT_OF_MEASUREMENT, PERCENTAGE, TEMP_CELSIUS
from homeassistant.setup import async_setup_component
from tests.common import mock_coro
@@ -76,13 +76,13 @@ def mock_client(hass, hass_client):
hass.loop.run_until_complete(async_setup_component(hass, "spaceapi", CONFIG))
hass.states.async_set(
"test.temp1", 25, attributes={"unit_of_measurement": TEMP_CELSIUS}
"test.temp1", 25, attributes={ATTR_UNIT_OF_MEASUREMENT: TEMP_CELSIUS}
)
hass.states.async_set(
"test.temp2", 23, attributes={"unit_of_measurement": TEMP_CELSIUS}
"test.temp2", 23, attributes={ATTR_UNIT_OF_MEASUREMENT: TEMP_CELSIUS}
)
hass.states.async_set(
"test.hum1", 88, attributes={"unit_of_measurement": PERCENTAGE}
"test.hum1", 88, attributes={ATTR_UNIT_OF_MEASUREMENT: PERCENTAGE}
)
return hass.loop.run_until_complete(hass_client())