SmartThings edge driver for heatit thermostats does not require cooling setpoint (#123188)
* remove cooling setpoint requirement for thermostats. Air conditioning remains unchanged * remove cooling setpoint requirement for thermostats. Air conditioning remains unchanged * versions should not be set on core integrations. * Added tests for minimal smartthings thermostat with no cooling. * Added tests for minimal smartthings thermostat with no cooling. * Formatted tests with ruff format
This commit is contained in:
parent
4b59ef4733
commit
7f4fca63ed
2 changed files with 42 additions and 1 deletions
|
@ -143,7 +143,6 @@ def get_capabilities(capabilities: Sequence[str]) -> Sequence[str] | None:
|
||||||
# Or must have all of these thermostat capabilities
|
# Or must have all of these thermostat capabilities
|
||||||
thermostat_capabilities = [
|
thermostat_capabilities = [
|
||||||
Capability.temperature_measurement,
|
Capability.temperature_measurement,
|
||||||
Capability.thermostat_cooling_setpoint,
|
|
||||||
Capability.thermostat_heating_setpoint,
|
Capability.thermostat_heating_setpoint,
|
||||||
Capability.thermostat_mode,
|
Capability.thermostat_mode,
|
||||||
]
|
]
|
||||||
|
|
|
@ -88,6 +88,26 @@ def basic_thermostat_fixture(device_factory):
|
||||||
return device
|
return device
|
||||||
|
|
||||||
|
|
||||||
|
@pytest.fixture(name="minimal_thermostat")
|
||||||
|
def minimal_thermostat_fixture(device_factory):
|
||||||
|
"""Fixture returns a minimal thermostat without cooling."""
|
||||||
|
device = device_factory(
|
||||||
|
"Minimal Thermostat",
|
||||||
|
capabilities=[
|
||||||
|
Capability.temperature_measurement,
|
||||||
|
Capability.thermostat_heating_setpoint,
|
||||||
|
Capability.thermostat_mode,
|
||||||
|
],
|
||||||
|
status={
|
||||||
|
Attribute.heating_setpoint: 68,
|
||||||
|
Attribute.thermostat_mode: "off",
|
||||||
|
Attribute.supported_thermostat_modes: ["off", "heat"],
|
||||||
|
},
|
||||||
|
)
|
||||||
|
device.status.attributes[Attribute.temperature] = Status(70, "F", None)
|
||||||
|
return device
|
||||||
|
|
||||||
|
|
||||||
@pytest.fixture(name="thermostat")
|
@pytest.fixture(name="thermostat")
|
||||||
def thermostat_fixture(device_factory):
|
def thermostat_fixture(device_factory):
|
||||||
"""Fixture returns a fully-featured thermostat."""
|
"""Fixture returns a fully-featured thermostat."""
|
||||||
|
@ -310,6 +330,28 @@ async def test_basic_thermostat_entity_state(
|
||||||
assert state.attributes[ATTR_CURRENT_TEMPERATURE] == 21.1 # celsius
|
assert state.attributes[ATTR_CURRENT_TEMPERATURE] == 21.1 # celsius
|
||||||
|
|
||||||
|
|
||||||
|
async def test_minimal_thermostat_entity_state(
|
||||||
|
hass: HomeAssistant, minimal_thermostat
|
||||||
|
) -> None:
|
||||||
|
"""Tests the state attributes properly match the thermostat type."""
|
||||||
|
await setup_platform(hass, CLIMATE_DOMAIN, devices=[minimal_thermostat])
|
||||||
|
state = hass.states.get("climate.minimal_thermostat")
|
||||||
|
assert state.state == HVACMode.OFF
|
||||||
|
assert (
|
||||||
|
state.attributes[ATTR_SUPPORTED_FEATURES]
|
||||||
|
== ClimateEntityFeature.TARGET_TEMPERATURE_RANGE
|
||||||
|
| ClimateEntityFeature.TARGET_TEMPERATURE
|
||||||
|
| ClimateEntityFeature.TURN_OFF
|
||||||
|
| ClimateEntityFeature.TURN_ON
|
||||||
|
)
|
||||||
|
assert ATTR_HVAC_ACTION not in state.attributes
|
||||||
|
assert sorted(state.attributes[ATTR_HVAC_MODES]) == [
|
||||||
|
HVACMode.HEAT,
|
||||||
|
HVACMode.OFF,
|
||||||
|
]
|
||||||
|
assert state.attributes[ATTR_CURRENT_TEMPERATURE] == 21.1 # celsius
|
||||||
|
|
||||||
|
|
||||||
async def test_thermostat_entity_state(hass: HomeAssistant, thermostat) -> None:
|
async def test_thermostat_entity_state(hass: HomeAssistant, thermostat) -> None:
|
||||||
"""Tests the state attributes properly match the thermostat type."""
|
"""Tests the state attributes properly match the thermostat type."""
|
||||||
await setup_platform(hass, CLIMATE_DOMAIN, devices=[thermostat])
|
await setup_platform(hass, CLIMATE_DOMAIN, devices=[thermostat])
|
||||||
|
|
Loading…
Add table
Reference in a new issue