mirror of
https://github.com/home-assistant/core.git
synced 2025-12-24 12:59:34 +00:00
Remove device class timestamp from device condition and trigger (#48431)
* Remove unit from garmin connect * Remove unit from hvv departures * Remove device class timestamp from device condition and trigger * Remove unit from systemmonitor * Use device class constant for timestamp in ring
This commit is contained in:
@@ -17,7 +17,10 @@ from tests.common import (
|
||||
mock_registry,
|
||||
)
|
||||
from tests.components.blueprint.conftest import stub_blueprint_populate # noqa: F401
|
||||
from tests.testing_config.custom_components.test.sensor import DEVICE_CLASSES
|
||||
from tests.testing_config.custom_components.test.sensor import (
|
||||
DEVICE_CLASSES,
|
||||
UNITS_OF_MEASUREMENT,
|
||||
)
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
@@ -69,6 +72,7 @@ async def test_get_conditions(hass, device_reg, entity_reg):
|
||||
"entity_id": platform.ENTITIES[device_class].entity_id,
|
||||
}
|
||||
for device_class in DEVICE_CLASSES
|
||||
if device_class in UNITS_OF_MEASUREMENT
|
||||
for condition in ENTITY_CONDITIONS[device_class]
|
||||
if device_class != "none"
|
||||
]
|
||||
|
||||
@@ -21,7 +21,10 @@ from tests.common import (
|
||||
mock_registry,
|
||||
)
|
||||
from tests.components.blueprint.conftest import stub_blueprint_populate # noqa: F401
|
||||
from tests.testing_config.custom_components.test.sensor import DEVICE_CLASSES
|
||||
from tests.testing_config.custom_components.test.sensor import (
|
||||
DEVICE_CLASSES,
|
||||
UNITS_OF_MEASUREMENT,
|
||||
)
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
@@ -73,11 +76,12 @@ async def test_get_triggers(hass, device_reg, entity_reg):
|
||||
"entity_id": platform.ENTITIES[device_class].entity_id,
|
||||
}
|
||||
for device_class in DEVICE_CLASSES
|
||||
if device_class in UNITS_OF_MEASUREMENT
|
||||
for trigger in ENTITY_TRIGGERS[device_class]
|
||||
if device_class != "none"
|
||||
]
|
||||
triggers = await async_get_device_automations(hass, "trigger", device_entry.id)
|
||||
assert len(triggers) == 14
|
||||
assert len(triggers) == 13
|
||||
assert triggers == expected_triggers
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user