mirror of
https://github.com/home-assistant/core.git
synced 2025-07-29 16:17:20 +00:00
Don't load from platform yaml
This commit is contained in:
parent
612cc91423
commit
ed68a21afd
@ -10,6 +10,7 @@ from homeassistant.components.sensor import DOMAIN as SENSOR_DOMAIN
|
||||
from homeassistant.const import (
|
||||
ATTR_UNIT_OF_MEASUREMENT,
|
||||
CONF_ENTITY_ID,
|
||||
CONF_PLATFORM,
|
||||
EVENT_HOMEASSISTANT_START,
|
||||
EVENT_STATE_CHANGED,
|
||||
STATE_UNKNOWN,
|
||||
@ -20,6 +21,22 @@ from homeassistant.setup import async_setup_component
|
||||
from tests.common import MockConfigEntry
|
||||
|
||||
|
||||
async def test_not_loading_from_platform_yaml(hass: HomeAssistant) -> None:
|
||||
"""Test compensation sensor not loaded from platform YAML."""
|
||||
config = {
|
||||
"sensor": [
|
||||
{
|
||||
CONF_PLATFORM: DOMAIN,
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
assert await async_setup_component(hass, SENSOR_DOMAIN, config)
|
||||
await hass.async_block_till_done()
|
||||
|
||||
assert len(hass.states.async_all()) == 0
|
||||
|
||||
|
||||
async def test_linear_state(hass: HomeAssistant) -> None:
|
||||
"""Test compensation sensor state."""
|
||||
config = {
|
||||
|
Loading…
x
Reference in New Issue
Block a user