Small cleanup in HomeWizard tests (#103837)
This commit is contained in:
parent
81450f0117
commit
5a452155fc
1 changed files with 10 additions and 24 deletions
|
@ -116,6 +116,16 @@ async def test_sensors(
|
||||||
"sensor.device_active_frequency",
|
"sensor.device_active_frequency",
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
(
|
||||||
|
"HWE-P1-unused-exports",
|
||||||
|
[
|
||||||
|
"sensor.device_total_energy_export",
|
||||||
|
"sensor.device_total_energy_export_tariff_1",
|
||||||
|
"sensor.device_total_energy_export_tariff_2",
|
||||||
|
"sensor.device_total_energy_export_tariff_3",
|
||||||
|
"sensor.device_total_energy_export_tariff_4",
|
||||||
|
],
|
||||||
|
),
|
||||||
(
|
(
|
||||||
"HWE-WTR",
|
"HWE-WTR",
|
||||||
[
|
[
|
||||||
|
@ -136,30 +146,6 @@ async def test_disabled_by_default_sensors(
|
||||||
assert entry.disabled_by is er.RegistryEntryDisabler.INTEGRATION
|
assert entry.disabled_by is er.RegistryEntryDisabler.INTEGRATION
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.parametrize("device_fixture", ["HWE-P1-unused-exports"])
|
|
||||||
@pytest.mark.parametrize(
|
|
||||||
"entity_id",
|
|
||||||
[
|
|
||||||
"sensor.device_total_energy_export",
|
|
||||||
"sensor.device_total_energy_export_tariff_1",
|
|
||||||
"sensor.device_total_energy_export_tariff_2",
|
|
||||||
"sensor.device_total_energy_export_tariff_3",
|
|
||||||
"sensor.device_total_energy_export_tariff_4",
|
|
||||||
],
|
|
||||||
)
|
|
||||||
async def test_disabled_by_default_sensors_when_unused(
|
|
||||||
hass: HomeAssistant,
|
|
||||||
entity_registry: er.EntityRegistry,
|
|
||||||
entity_id: str,
|
|
||||||
) -> None:
|
|
||||||
"""Test the disabled by default unused sensors."""
|
|
||||||
assert not hass.states.get(entity_id)
|
|
||||||
|
|
||||||
assert (entry := entity_registry.async_get(entity_id))
|
|
||||||
assert entry.disabled
|
|
||||||
assert entry.disabled_by is er.RegistryEntryDisabler.INTEGRATION
|
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.parametrize("exception", [RequestError, DisabledError])
|
@pytest.mark.parametrize("exception", [RequestError, DisabledError])
|
||||||
async def test_sensors_unreachable(
|
async def test_sensors_unreachable(
|
||||||
hass: HomeAssistant,
|
hass: HomeAssistant,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue