mirror of
https://github.com/home-assistant/core.git
synced 2025-07-19 11:17:21 +00:00
parent
8b46b5591f
commit
672db9cfe9
@ -177,7 +177,11 @@ WITHINGS_ATTRIBUTES = [
|
|||||||
const.MEAS_SPO2_PCT, MeasureType.SP02, "SP02", const.UOM_PERCENT, None
|
const.MEAS_SPO2_PCT, MeasureType.SP02, "SP02", const.UOM_PERCENT, None
|
||||||
),
|
),
|
||||||
WithingsMeasureAttribute(
|
WithingsMeasureAttribute(
|
||||||
const.MEAS_HYDRATION, MeasureType.HYDRATION, "Hydration", "", "mdi:water"
|
const.MEAS_HYDRATION,
|
||||||
|
MeasureType.HYDRATION,
|
||||||
|
"Hydration",
|
||||||
|
const.UOM_PERCENT,
|
||||||
|
"mdi:water",
|
||||||
),
|
),
|
||||||
WithingsMeasureAttribute(
|
WithingsMeasureAttribute(
|
||||||
const.MEAS_PWV,
|
const.MEAS_PWV,
|
||||||
|
@ -11,7 +11,6 @@ from homeassistant.components.withings.common import (
|
|||||||
NotAuthenticatedError,
|
NotAuthenticatedError,
|
||||||
WithingsDataManager,
|
WithingsDataManager,
|
||||||
)
|
)
|
||||||
from homeassistant.core import HomeAssistant
|
|
||||||
from homeassistant.exceptions import PlatformNotReady
|
from homeassistant.exceptions import PlatformNotReady
|
||||||
from homeassistant.util import dt
|
from homeassistant.util import dt
|
||||||
|
|
||||||
@ -27,17 +26,6 @@ def withings_api_fixture() -> WithingsApi:
|
|||||||
return withings_api
|
return withings_api
|
||||||
|
|
||||||
|
|
||||||
@pytest.fixture
|
|
||||||
def mock_time_zone():
|
|
||||||
"""Provide an alternative time zone."""
|
|
||||||
patch_time_zone = patch(
|
|
||||||
"homeassistant.util.dt.DEFAULT_TIME_ZONE",
|
|
||||||
new=dt.get_time_zone("America/Los_Angeles"),
|
|
||||||
)
|
|
||||||
with patch_time_zone:
|
|
||||||
yield
|
|
||||||
|
|
||||||
|
|
||||||
@pytest.fixture(name="data_manager")
|
@pytest.fixture(name="data_manager")
|
||||||
def data_manager_fixture(hass, withings_api: WithingsApi) -> WithingsDataManager:
|
def data_manager_fixture(hass, withings_api: WithingsApi) -> WithingsDataManager:
|
||||||
"""Provide data manager."""
|
"""Provide data manager."""
|
||||||
@ -122,9 +110,15 @@ async def test_data_manager_call_throttle_disabled(
|
|||||||
|
|
||||||
|
|
||||||
async def test_data_manager_update_sleep_date_range(
|
async def test_data_manager_update_sleep_date_range(
|
||||||
hass: HomeAssistant, data_manager: WithingsDataManager, mock_time_zone
|
data_manager: WithingsDataManager,
|
||||||
) -> None:
|
) -> None:
|
||||||
"""Test method."""
|
"""Test method."""
|
||||||
|
patch_time_zone = patch(
|
||||||
|
"homeassistant.util.dt.DEFAULT_TIME_ZONE",
|
||||||
|
new=dt.get_time_zone("America/Los_Angeles"),
|
||||||
|
)
|
||||||
|
|
||||||
|
with patch_time_zone:
|
||||||
update_start_time = dt.now()
|
update_start_time = dt.now()
|
||||||
await data_manager.update_sleep()
|
await data_manager.update_sleep()
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user