Add button platform to pyLoad integration (#120359)
This commit is contained in:
parent
adc074f60a
commit
fd0fee1900
8 changed files with 420 additions and 2 deletions
|
@ -1,6 +1,7 @@
|
|||
"""Tests for the pyLoad Sensors."""
|
||||
|
||||
from unittest.mock import AsyncMock
|
||||
from collections.abc import AsyncGenerator
|
||||
from unittest.mock import AsyncMock, patch
|
||||
|
||||
from freezegun.api import FrozenDateTimeFactory
|
||||
from pyloadapi.exceptions import CannotConnect, InvalidAuth, ParserError
|
||||
|
@ -11,6 +12,7 @@ from homeassistant.components.pyload.const import DOMAIN
|
|||
from homeassistant.components.pyload.coordinator import SCAN_INTERVAL
|
||||
from homeassistant.components.sensor import DOMAIN as SENSOR_DOMAIN
|
||||
from homeassistant.config_entries import ConfigEntryState
|
||||
from homeassistant.const import Platform
|
||||
from homeassistant.core import DOMAIN as HOMEASSISTANT_DOMAIN, HomeAssistant
|
||||
from homeassistant.helpers import entity_registry as er, issue_registry as ir
|
||||
from homeassistant.helpers.typing import ConfigType
|
||||
|
@ -19,6 +21,16 @@ from homeassistant.setup import async_setup_component
|
|||
from tests.common import MockConfigEntry, async_fire_time_changed, snapshot_platform
|
||||
|
||||
|
||||
@pytest.fixture(autouse=True)
|
||||
async def sensor_only() -> AsyncGenerator[None, None]:
|
||||
"""Enable only the sensor platform."""
|
||||
with patch(
|
||||
"homeassistant.components.pyload.PLATFORMS",
|
||||
[Platform.SENSOR],
|
||||
):
|
||||
yield
|
||||
|
||||
|
||||
async def test_setup(
|
||||
hass: HomeAssistant,
|
||||
config_entry: MockConfigEntry,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue