mirror of
https://github.com/home-assistant/core.git
synced 2025-07-19 11:17:21 +00:00
Use platform enums in utility_meter tests (#62553)
This commit is contained in:
parent
563e6b3e80
commit
5e25df91b2
@ -2,7 +2,6 @@
|
|||||||
from datetime import timedelta
|
from datetime import timedelta
|
||||||
from unittest.mock import patch
|
from unittest.mock import patch
|
||||||
|
|
||||||
from homeassistant.components.sensor import DOMAIN as SENSOR_DOMAIN
|
|
||||||
from homeassistant.components.utility_meter.const import (
|
from homeassistant.components.utility_meter.const import (
|
||||||
ATTR_TARIFF,
|
ATTR_TARIFF,
|
||||||
DOMAIN,
|
DOMAIN,
|
||||||
@ -17,6 +16,7 @@ from homeassistant.const import (
|
|||||||
CONF_PLATFORM,
|
CONF_PLATFORM,
|
||||||
ENERGY_KILO_WATT_HOUR,
|
ENERGY_KILO_WATT_HOUR,
|
||||||
EVENT_HOMEASSISTANT_START,
|
EVENT_HOMEASSISTANT_START,
|
||||||
|
Platform,
|
||||||
)
|
)
|
||||||
from homeassistant.core import State
|
from homeassistant.core import State
|
||||||
from homeassistant.setup import async_setup_component
|
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, 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()
|
await hass.async_block_till_done()
|
||||||
|
|
||||||
# restore from cache
|
# 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, 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()
|
await hass.async_block_till_done()
|
||||||
|
|
||||||
hass.bus.async_fire(EVENT_HOMEASSISTANT_START)
|
hass.bus.async_fire(EVENT_HOMEASSISTANT_START)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user