Skip to content

Commit a29be76

Browse files
bouwewCoMPaTech
authored andcommitted
Improve thinker_thermostat_temp()
1 parent a6fd008 commit a29be76

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

tests/test_init.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -501,24 +501,27 @@ async def tinker_thermostat_temp(
501501
):
502502
"""Toggle temperature to test functionality."""
503503
_LOGGER.info("Asserting modifying settings in location (%s):", loc_id)
504+
tinker_temp_passed = False
504505
test_temp = {"setpoint": 22.9}
505506
if smile._cooling_present and not block_cooling:
506507
test_temp = {"setpoint_low": 19.5, "setpoint_high": 23.5}
507508
_LOGGER.info("- Adjusting temperature to %s", test_temp)
508509
try:
509510
await smile.set_temperature(loc_id, test_temp)
510511
_LOGGER.info(" + tinker_thermostat_temp worked as intended")
511-
return True
512+
tinker_temp_passed = True
512513
except (
513514
pw_exceptions.ErrorSendingCommandError,
514515
pw_exceptions.ResponseError,
515516
):
516517
if unhappy:
517518
_LOGGER.info(" + tinker_thermostat_temp failed as expected")
518-
return True
519+
tinker_temp_passed = True
519520
else: # pragma: no cover
520521
_LOGGER.info(" - tinker_thermostat_temp failed unexpectedly")
521-
return True
522+
return False
523+
524+
return tinker_temp_passed
522525

523526
@pytest.mark.asyncio
524527
async def tinker_thermostat_preset(self, smile, loc_id, unhappy=False):

0 commit comments

Comments
 (0)