mirror of
https://github.com/home-assistant/core.git
synced 2025-12-24 12:59:34 +00:00
Import util.dt as dt_util in components/[p-s]* (#93761)
This commit is contained in:
@@ -11,7 +11,7 @@ from homeassistant.components.shelly.utils import (
|
||||
get_rpc_input_triggers,
|
||||
is_block_momentary_input,
|
||||
)
|
||||
from homeassistant.util import dt
|
||||
from homeassistant.util import dt as dt_util
|
||||
|
||||
DEVICE_BLOCK_ID = 4
|
||||
|
||||
@@ -153,12 +153,12 @@ async def test_get_block_device_sleep_period(settings, sleep_period) -> None:
|
||||
async def test_get_device_uptime() -> None:
|
||||
"""Test block test get device uptime."""
|
||||
assert get_device_uptime(
|
||||
55, dt.as_utc(dt.parse_datetime("2019-01-10 18:42:00+00:00"))
|
||||
) == dt.as_utc(dt.parse_datetime("2019-01-10 18:42:00+00:00"))
|
||||
55, dt_util.as_utc(dt_util.parse_datetime("2019-01-10 18:42:00+00:00"))
|
||||
) == dt_util.as_utc(dt_util.parse_datetime("2019-01-10 18:42:00+00:00"))
|
||||
|
||||
assert get_device_uptime(
|
||||
50, dt.as_utc(dt.parse_datetime("2019-01-10 18:42:00+00:00"))
|
||||
) == dt.as_utc(dt.parse_datetime("2019-01-10 18:42:10+00:00"))
|
||||
50, dt_util.as_utc(dt_util.parse_datetime("2019-01-10 18:42:00+00:00"))
|
||||
) == dt_util.as_utc(dt_util.parse_datetime("2019-01-10 18:42:10+00:00"))
|
||||
|
||||
|
||||
async def test_get_block_input_triggers(mock_block_device, monkeypatch) -> None:
|
||||
|
||||
Reference in New Issue
Block a user