@@ -275,17 +275,20 @@ async def connect(self) -> bool:
275275 dsmrmain = result .find ("./module/protocols/dsmrmain" )
276276 if "Plugwise" not in names :
277277 if dsmrmain is None : # pragma: no cover
278- raise ConnectionFailedError (
279- f "Connected but expected text not returned, \
280- we got { result } . Please create an issue on \
281- http://github.com/plugwise/python-plugwise"
278+ LOGGER . error (
279+ "Connected but expected text not returned, we got %s. Please create \
280+ an issue on http://github.com/plugwise/python-plugwise" ,
281+ result ,
282282 )
283+ raise ConnectionFailedError ("Plugwise error, check log for more info." )
283284
284285 # Check if Anna is connected to an Adam
285286 if "159.2" in models :
287+ LOGGER .error (
288+ "Your Anna is connected to an Adam, make sure to only add the Adam as integration."
289+ )
286290 raise InvalidSetupError (
287- "Your Anna is connected to an Adam, make \
288- sure to only add the Adam as integration."
291+ "Plugwise invalid setup error, check log for more info."
289292 )
290293
291294 # Determine smile specifics
@@ -337,10 +340,11 @@ async def _smile_detect_legacy(self, result: etree, dsmrmain: etree) -> str:
337340
338341 else : # pragma: no cover
339342 # No cornercase, just end of the line
340- raise ConnectionFailedError (
343+ LOGGER . error (
341344 "Connected but no gateway device information found, please create \
342345 an issue on http://github.com/plugwise/python-plugwise"
343346 )
347+ raise ConnectionFailedError ("Plugwise error, check log for more info." )
344348
345349 return model
346350
@@ -360,20 +364,22 @@ async def _smile_detect(self, result: etree, dsmrmain: etree) -> None:
360364
361365 if model is None or self .smile_fw_version is None : # pragma: no cover
362366 # Corner case check
363- raise UnsupportedDeviceError (
367+ LOGGER . error (
364368 "Unable to find model or version information, please create \
365369 an issue on http://github.com/plugwise/python-plugwise"
366370 )
371+ raise UnsupportedDeviceError ("Plugwise error, check log for more info." )
367372
368373 ver = semver .VersionInfo .parse (self .smile_fw_version )
369374 target_smile = f"{ model } _v{ ver .major } "
370375 LOGGER .debug ("Plugwise identified as %s" , target_smile )
371376 if target_smile not in SMILES :
372- raise UnsupportedDeviceError (
373- " Your version Smile identified as {target_smile} seems\
374- unsupported by our plugin, please create an issue\
375- on http://github.com/plugwise/python-plugwise"
377+ LOGGER . error (
378+ ' Your version Smile identified as "%s" seems unsupported by our plugin, please \
379+ create an issue on http://github.com/plugwise/python-plugwise' ,
380+ target_smile ,
376381 )
382+ raise UnsupportedDeviceError ("Plugwise error, check log for more info." )
377383
378384 self .smile_name = SMILES [target_smile ]["friendly_name" ]
379385 self .smile_type = SMILES [target_smile ]["type" ]
@@ -467,7 +473,7 @@ async def _set_schedule_state_legacy(self, name: str, status: str) -> None:
467473 schedule_rule_id = rule .attrib ["id" ]
468474
469475 if schedule_rule_id is None :
470- raise PlugwiseError ("No schedule available." )
476+ raise PlugwiseError ("Plugwise: no schedule available." )
471477
472478 state = "false"
473479 if status == "on" :
@@ -495,7 +501,7 @@ async def set_schedule_state(self, loc_id: str, name: str, state: str) -> None:
495501
496502 schedule_rule = self ._rule_ids_by_name (name , loc_id )
497503 if not schedule_rule or schedule_rule is None :
498- raise PlugwiseError ("No schedule with this name available." )
504+ raise PlugwiseError ("Plugwise: no schedule with this name available." )
499505
500506 schedule_rule_id : str = next (iter (schedule_rule ))
501507
@@ -534,7 +540,7 @@ async def _set_preset_legacy(self, preset: str) -> None:
534540 """Set the given Preset on the relevant Thermostat - from DOMAIN_OBJECTS."""
535541 locator = f'rule/directives/when/then[@icon="{ preset } "].../.../...'
536542 if (rule := self ._domain_objects .find (locator )) is None :
537- raise PlugwiseError ("Invalid preset." )
543+ raise PlugwiseError ("Plugwise: invalid preset." )
538544
539545 uri = RULES
540546 data = f'<rules><rule id="{ rule .attrib ["id" ]} "><active>true</active></rule></rules>'
@@ -552,7 +558,7 @@ async def set_preset(self, loc_id: str, preset: str) -> None:
552558 location_type = current_location .find ("type" ).text
553559
554560 if preset not in self ._presets (loc_id ):
555- raise PlugwiseError ("Invalid preset." )
561+ raise PlugwiseError ("Plugwise: invalid preset." )
556562
557563 uri = f"{ LOCATIONS } ;id={ loc_id } "
558564 data = (
@@ -639,14 +645,14 @@ async def set_switch_state(
639645 lock_state : str = self ._appliances .find (locator ).text
640646 # Don't bother switching a relay when the corresponding lock-state is true
641647 if lock_state == "true" :
642- raise PlugwiseError ("Cannot switch a locked Relay." )
648+ raise PlugwiseError ("Plugwise: the locked Relay was not switched ." )
643649
644650 await self ._request (uri , method = "put" , data = data )
645651
646652 async def set_regulation_mode (self , mode : str ) -> None :
647653 """Set the heating regulation mode."""
648654 if mode not in self ._allowed_modes :
649- raise PlugwiseError ("Invalid regulation mode." )
655+ raise PlugwiseError ("Plugwise: invalid regulation mode." )
650656
651657 uri = f"{ APPLIANCES } ;type=gateway/regulation_mode_control"
652658 duration = ""
0 commit comments