Use platform enums in utility_meter tests (#62553)

This commit is contained in:
Robert Hillis 2021-12-22 04:43:33 -05:00 committed by GitHub
parent 563e6b3e80
commit 5e25df91b2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -2,7 +2,6 @@
from datetime import timedelta
from unittest.mock import patch
from homeassistant.components.sensor import DOMAIN as SENSOR_DOMAIN
from homeassistant.components.utility_meter.const import (
ATTR_TARIFF,
DOMAIN,
@ -17,6 +16,7 @@ from homeassistant.const import (
CONF_PLATFORM,
ENERGY_KILO_WATT_HOUR,
EVENT_HOMEASSISTANT_START,
Platform,
)
from homeassistant.core import State
from homeassistant.setup import async_setup_component
@ -46,7 +46,7 @@ async def test_restore_state(hass):
)
assert await async_setup_component(hass, DOMAIN, config)
assert await async_setup_component(hass, SENSOR_DOMAIN, config)
assert await async_setup_component(hass, Platform.SENSOR, config)
await hass.async_block_till_done()
# restore from cache
@ -67,7 +67,7 @@ async def test_services(hass):
}
assert await async_setup_component(hass, DOMAIN, config)
assert await async_setup_component(hass, SENSOR_DOMAIN, config)
assert await async_setup_component(hass, Platform.SENSOR, config)
await hass.async_block_till_done()
hass.bus.async_fire(EVENT_HOMEASSISTANT_START)