mirror of
https://github.com/home-assistant/core.git
synced 2025-04-26 02:07:54 +00:00
Migrate balboa tests to use unit system (#140371)
This commit is contained in:
parent
d2124db3ec
commit
25d6974137
@ -26,10 +26,11 @@ from homeassistant.components.climate import (
|
|||||||
HVACAction,
|
HVACAction,
|
||||||
HVACMode,
|
HVACMode,
|
||||||
)
|
)
|
||||||
from homeassistant.const import ATTR_TEMPERATURE, Platform, UnitOfTemperature
|
from homeassistant.const import ATTR_TEMPERATURE, Platform
|
||||||
from homeassistant.core import HomeAssistant, State
|
from homeassistant.core import HomeAssistant, State
|
||||||
from homeassistant.exceptions import ServiceValidationError
|
from homeassistant.exceptions import ServiceValidationError
|
||||||
from homeassistant.helpers import entity_registry as er
|
from homeassistant.helpers import entity_registry as er
|
||||||
|
from homeassistant.util.unit_system import US_CUSTOMARY_SYSTEM
|
||||||
|
|
||||||
from . import client_update, init_integration
|
from . import client_update, init_integration
|
||||||
|
|
||||||
@ -97,9 +98,8 @@ async def test_spa_temperature_unit(
|
|||||||
hass: HomeAssistant, client: MagicMock, integration: MockConfigEntry
|
hass: HomeAssistant, client: MagicMock, integration: MockConfigEntry
|
||||||
) -> None:
|
) -> None:
|
||||||
"""Test temperature unit conversions."""
|
"""Test temperature unit conversions."""
|
||||||
with patch.object(
|
hass.config.units = US_CUSTOMARY_SYSTEM
|
||||||
hass.config.units, "temperature_unit", UnitOfTemperature.FAHRENHEIT
|
|
||||||
):
|
|
||||||
state = await _patch_spa_settemp(hass, client, 0, 15.4)
|
state = await _patch_spa_settemp(hass, client, 0, 15.4)
|
||||||
assert state.attributes.get(ATTR_TEMPERATURE) == 15.0
|
assert state.attributes.get(ATTR_TEMPERATURE) == 15.0
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user