@@ -354,8 +354,8 @@ async def connect(self) -> bool:
354354 dsmrmain = result .find ("./module/protocols/dsmrmain" )
355355 if "Plugwise" not in names and dsmrmain is None : # pragma: no cover
356356 LOGGER .error (
357- "Connected but expected text not returned, we got %s. Please create \
358- an issue on http://github.com/plugwise/python-plugwise" ,
357+ "Connected but expected text not returned, we got %s. Please create"
358+ " an issue on http://github.com/plugwise/python-plugwise" ,
359359 result ,
360360 )
361361 raise ResponseError
@@ -416,8 +416,8 @@ async def _smile_detect_legacy(
416416 else : # pragma: no cover
417417 # No cornercase, just end of the line
418418 LOGGER .error (
419- "Connected but no gateway device information found, please create \
420- an issue on http://github.com/plugwise/python-plugwise"
419+ "Connected but no gateway device information found, please create"
420+ " an issue on http://github.com/plugwise/python-plugwise"
421421 )
422422 raise ResponseError
423423
@@ -442,8 +442,8 @@ async def _smile_detect(self, result: etree, dsmrmain: etree) -> None:
442442 if model == "Unknown" or self .smile_fw_version is None : # pragma: no cover
443443 # Corner case check
444444 LOGGER .error (
445- "Unable to find model or version information, please create \
446- an issue on http://github.com/plugwise/python-plugwise"
445+ "Unable to find model or version information, please create"
446+ " an issue on http://github.com/plugwise/python-plugwise"
447447 )
448448 raise UnsupportedDeviceError
449449
@@ -452,8 +452,8 @@ async def _smile_detect(self, result: etree, dsmrmain: etree) -> None:
452452 LOGGER .debug ("Plugwise identified as %s" , target_smile )
453453 if target_smile not in SMILES :
454454 LOGGER .error (
455- ' Your version Smile identified as "%s" seems unsupported by our plugin, please \
456- create an issue on http://github.com/plugwise/python-plugwise' ,
455+ " Your version Smile identified as %s seems unsupported by our plugin, please"
456+ " create an issue on http://github.com/plugwise/python-plugwise" ,
457457 target_smile ,
458458 )
459459 raise UnsupportedDeviceError
@@ -682,20 +682,23 @@ async def set_temperature(self, loc_id: str, items: dict[str, float]) -> None:
682682 setpoint = items ["setpoint" ]
683683
684684 if self ._cooling_present :
685- if "setpoint_high" in items :
686- tmp_setpoint_high = items ["setpoint_high" ]
687- tmp_setpoint_low = items ["setpoint_low" ]
685+ if "setpoint_high" not in items :
686+ raise PlugwiseError (
687+ "Plugwise: failed setting temperature: no valid input provided"
688+ )
689+ tmp_setpoint_high = items ["setpoint_high" ]
690+ tmp_setpoint_low = items ["setpoint_low" ]
688691 if self ._cooling_enabled : # in cooling mode
689692 setpoint = tmp_setpoint_high
690693 if tmp_setpoint_low != MIN_SETPOINT :
691694 raise PlugwiseError (
692- "Plugwise: heating setpoint cannot be changed when in cooling mode! "
695+ "Plugwise: heating setpoint cannot be changed when in cooling mode"
693696 )
694697 else : # in heating mode
695698 setpoint = tmp_setpoint_low
696699 if tmp_setpoint_high != MAX_SETPOINT :
697700 raise PlugwiseError (
698- "Plugwise: cooling setpoint cannot be changed when in heating mode! "
701+ "Plugwise: cooling setpoint cannot be changed when in heating mode"
699702 )
700703
701704 if setpoint is None :
0 commit comments