* Modernize nuheat for new climate platform * Home Assistant state now mirrors the state displayed at mynewheat.com * Remove off mode as the device does not implement and setting was not implemented anyways * Implement missing set_hvac_mode for nuheat * Now shows as unavailable when offline * Add a unique id (serial number) * Fix hvac_mode as it was really implementing hvac_action * Presets now map to the open api spec published at https://api.mynuheat.com/swagger/ * ThermostatModel: scheduleMode * Revert test cleanup as it leaves files behind. Its going to be more invasive to modernize the tests so it will have to come in a new pr * Config flow for nuheat * codeowners * Add an import test as well * remove debug
23 lines
731 B
Python
23 lines
731 B
Python
"""NuHeat component tests."""
|
|
from unittest.mock import patch
|
|
|
|
from homeassistant.components.nuheat.const import DOMAIN
|
|
from homeassistant.setup import async_setup_component
|
|
|
|
from .mocks import _get_mock_nuheat
|
|
|
|
VALID_CONFIG = {
|
|
"nuheat": {"username": "warm", "password": "feet", "devices": "thermostat123"}
|
|
}
|
|
INVALID_CONFIG = {"nuheat": {"username": "warm", "password": "feet"}}
|
|
|
|
|
|
async def test_init_success(hass):
|
|
"""Test that we can setup with valid config."""
|
|
mock_nuheat = _get_mock_nuheat()
|
|
|
|
with patch(
|
|
"homeassistant.components.nuheat.nuheat.NuHeat", return_value=mock_nuheat,
|
|
):
|
|
assert await async_setup_component(hass, DOMAIN, VALID_CONFIG)
|
|
await hass.async_block_till_done()
|