Skip to content

Commit

Permalink
Retrieve min and max temperatures when in emergency heat mode
Browse files Browse the repository at this point in the history
  • Loading branch information
PeteRager committed Jan 6, 2024
1 parent dcf1b6f commit 0386880
Show file tree
Hide file tree
Showing 6 changed files with 32 additions and 12 deletions.
22 changes: 14 additions & 8 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,17 @@
{
"version": "0.2.0",
"configurations": [
{
"name": "Debug test",
"type": "python",
"request": "attach",
"justMyCode": false
}
]
{
"name": "Python: Debug Tests",
"type": "python",
"request": "launch",
"program": "${file}",
"purpose": ["debug-test"],
"console": "integratedTerminal",
"justMyCode": false,
"presentation": {
"hidden": true, // keep original launch order in 'run and debug' tab
}
},
],
"version": "0.2.0"
}
8 changes: 6 additions & 2 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
{
"python.testing.pytestArgs": ["tests", "--asyncio-mode=auto"],
"python.testing.pytestArgs": [
"tests","--asyncio-mode=auto"
],
"python.testing.unittestEnabled": false,
"python.testing.pytestEnabled": true,
"python.experiments.enabled": false,
"cSpell.words": [
"ASHRAE",
"automations",
Expand All @@ -26,5 +29,6 @@
"python.linting.flake8Enabled": false,
"python.linting.enabled": true,
"python.linting.flake8Args": ["--config=setup.cfg", "--doctests"],
"python.linting.pylintEnabled": true
"python.linting.pylintEnabled": true,

}
4 changes: 2 additions & 2 deletions custom_components/lennoxs30/climate.py
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ def min_temp(self):
if self._manager.is_metric is False:
return self._zone.minCsp
return self._zone.minCspC
if self._zone.systemMode == LENNOX_HVAC_HEAT:
if self._zone.systemMode in [LENNOX_HVAC_HEAT,LENNOX_HVAC_EMERGENCY_HEAT]:
if self._manager.is_metric is False:
return self._zone.minHsp
return self._zone.minHspC
Expand All @@ -264,7 +264,7 @@ def max_temp(self):
if self._manager.is_metric is False:
return self._zone.maxCsp
return self._zone.maxCspC
if self._zone.systemMode == LENNOX_HVAC_HEAT:
if self._zone.systemMode in [LENNOX_HVAC_HEAT,LENNOX_HVAC_EMERGENCY_HEAT]:
if self._manager.is_metric is False:
return self._zone.maxHsp
return self._zone.maxHspC
Expand Down
2 changes: 2 additions & 0 deletions pytest.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[pytest]
addopts = --allow-unix-socket
4 changes: 4 additions & 0 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,10 @@
pytest_plugins = "pytest_homeassistant_custom_component"


@pytest.fixture(autouse=True)
def socket_enabled():
pass

@pytest.fixture(autouse=True)
def auto_enable_custom_integrations(enable_custom_integrations):
yield
Expand Down
4 changes: 4 additions & 0 deletions tests/test_climate.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,10 @@ async def test_climate_min_max_c(hass, manager_mz: Manager):
assert c.min_temp == zone.minHspC
assert c.max_temp == zone.maxHspC

zone.systemMode = LENNOX_HVAC_EMERGENCY_HEAT
assert c.min_temp == zone.minHspC
assert c.max_temp == zone.maxHspC

assert system.single_setpoint_mode is True
zone.systemMode = LENNOX_HVAC_HEAT_COOL
assert c.min_temp == zone.minCspC
Expand Down

0 comments on commit 0386880

Please sign in to comment.