Skip to content

Commit 18eeb65

Browse files
committed
Simplify tinker_thermostat-testing
1 parent 4fbd44a commit 18eeb65

File tree

1 file changed

+10
-26
lines changed

1 file changed

+10
-26
lines changed

tests/test_init.py

Lines changed: 10 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -686,30 +686,6 @@ async def tinker_thermostat_temp(
686686

687687
return tinker_temp_passed
688688

689-
@pytest.mark.asyncio
690-
async def tinker_legacy_thermostat_temp(self, smile, unhappy=False):
691-
"""Toggle temperature to test functionality."""
692-
_LOGGER.info("Assert modifying temperature setpoint")
693-
tinker_temp_passed = False
694-
test_temp = {"setpoint": 22.9}
695-
_LOGGER.info("- Adjusting temperature to %s", test_temp)
696-
try:
697-
await smile.set_temperature("dummy", test_temp)
698-
_LOGGER.info(" + worked as intended")
699-
tinker_temp_passed = True
700-
except (
701-
pw_exceptions.ErrorSendingCommandError,
702-
pw_exceptions.ResponseError,
703-
):
704-
if unhappy:
705-
_LOGGER.info(" + failed as expected")
706-
tinker_temp_passed = True
707-
else: # pragma: no cover
708-
_LOGGER.info(" - failed unexpectedly")
709-
tinker_temp_passed = False
710-
711-
return tinker_temp_passed
712-
713689
@pytest.mark.asyncio
714690
async def tinker_thermostat_preset(self, smile, loc_id, unhappy=False):
715691
"""Toggle preset to test functionality."""
@@ -843,9 +819,17 @@ async def tinker_thermostat(
843819
return result_1 and result_2 and result_3
844820

845821
@pytest.mark.asyncio
846-
async def tinker_legacy_thermostat(self, smile, schedule_on=True, unhappy=False):
822+
async def tinker_legacy_thermostat(
823+
self,
824+
smile,
825+
schedule_on=True,
826+
block_cooling=False,
827+
unhappy=False
828+
):
847829
"""Toggle various climate settings to test functionality."""
848-
result_1 = await self.tinker_legacy_thermostat_temp(smile, unhappy)
830+
result_1 = await self.tinker_thermostat_temp(
831+
smile, "dummy", block_cooling, unhappy
832+
)
849833
result_2 = await self.tinker_thermostat_preset(smile, None, unhappy)
850834
result_3 = await self.tinker_legacy_thermostat_schedule(smile, unhappy)
851835
if schedule_on:

0 commit comments

Comments
 (0)