Skip to content

Commit 7ee9bf3

Browse files
committed
raise ConnectionFailedError instead of PlugwiseError
1 parent 59c7bc8 commit 7ee9bf3

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

plugwise/__init__.py

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -327,7 +327,7 @@ async def set_select(
327327
try:
328328
await self._smile_api.set_select(key, loc_id, option, state)
329329
except ConnectionFailedError as exc:
330-
raise PlugwiseError(f"Failed to set select: {str(exc)}") from exc
330+
raise ConnectionFailedError(f"Failed to set select: {str(exc)}") from exc
331331

332332
async def set_schedule_state(
333333
self,
@@ -339,22 +339,22 @@ async def set_schedule_state(
339339
try:
340340
await self._smile_api.set_schedule_state(loc_id, state, name)
341341
except ConnectionFailedError as exc:
342-
raise PlugwiseError(f"Failed to set schedule state: {str(exc)}") from exc
342+
raise ConnectionFailedError(f"Failed to set schedule state: {str(exc)}") from exc
343343

344344

345345
async def set_preset(self, loc_id: str, preset: str) -> None:
346346
"""Set the given Preset on the relevant Thermostat."""
347347
try:
348348
await self._smile_api.set_preset(loc_id, preset)
349349
except ConnectionFailedError as exc:
350-
raise PlugwiseError(f"Failed to set preset: {str(exc)}") from exc
350+
raise ConnectionFailedError(f"Failed to set preset: {str(exc)}") from exc
351351

352352
async def set_temperature(self, loc_id: str, items: dict[str, float]) -> None:
353353
"""Set the given Temperature on the relevant Thermostat."""
354354
try:
355355
await self._smile_api.set_temperature(loc_id, items)
356356
except ConnectionFailedError as exc:
357-
raise PlugwiseError(f"Failed to set temperature: {str(exc)}") from exc
357+
raise ConnectionFailedError(f"Failed to set temperature: {str(exc)}") from exc
358358

359359
async def set_number(
360360
self,
@@ -366,14 +366,14 @@ async def set_number(
366366
try:
367367
await self._smile_api.set_number(dev_id, key, temperature)
368368
except ConnectionFailedError as exc:
369-
raise PlugwiseError(f"Failed to set number: {str(exc)}") from exc
369+
raise ConnectionFailedError(f"Failed to set number: {str(exc)}") from exc
370370

371371
async def set_temperature_offset(self, dev_id: str, offset: float) -> None:
372372
"""Set the Temperature offset for thermostats that support this feature."""
373373
try:
374374
await self._smile_api.set_offset(dev_id, offset) # pragma: no cover
375375
except ConnectionFailedError as exc:
376-
raise PlugwiseError(f"Failed to set temperature offset: {str(exc)}") from exc
376+
raise ConnectionFailedError(f"Failed to set temperature offset: {str(exc)}") from exc
377377

378378
async def set_switch_state(
379379
self, appl_id: str, members: list[str] | None, model: str, state: str
@@ -382,39 +382,39 @@ async def set_switch_state(
382382
try:
383383
await self._smile_api.set_switch_state(appl_id, members, model, state)
384384
except ConnectionFailedError as exc:
385-
raise PlugwiseError(f"Failed to set switch state: {str(exc)}") from exc
385+
raise ConnectionFailedError(f"Failed to set switch state: {str(exc)}") from exc
386386

387387
async def set_gateway_mode(self, mode: str) -> None:
388388
"""Set the gateway mode."""
389389
try:
390390
await self._smile_api.set_gateway_mode(mode) # pragma: no cover
391391
except ConnectionFailedError as exc:
392-
raise PlugwiseError(f"Failed to set gateway mode: {str(exc)}") from exc
392+
raise ConnectionFailedError(f"Failed to set gateway mode: {str(exc)}") from exc
393393

394394
async def set_regulation_mode(self, mode: str) -> None:
395395
"""Set the heating regulation mode."""
396396
try:
397397
await self._smile_api.set_regulation_mode(mode) # pragma: no cover
398398
except ConnectionFailedError as exc:
399-
raise PlugwiseError(f"Failed to set regulation mode: {str(exc)}") from exc
399+
raise ConnectionFailedError(f"Failed to set regulation mode: {str(exc)}") from exc
400400

401401
async def set_dhw_mode(self, mode: str) -> None:
402402
"""Set the domestic hot water heating regulation mode."""
403403
try:
404404
await self._smile_api.set_dhw_mode(mode) # pragma: no cover
405405
except ConnectionFailedError as exc:
406-
raise PlugwiseError(f"Failed to set dhw mode: {str(exc)}") from exc
406+
raise ConnectionFailedError(f"Failed to set dhw mode: {str(exc)}") from exc
407407

408408
async def delete_notification(self) -> None:
409409
"""Delete the active Plugwise Notification."""
410410
try:
411411
await self._smile_api.delete_notification()
412412
except ConnectionFailedError as exc:
413-
raise PlugwiseError(f"Failed to delete notification: {str(exc)}") from exc
413+
raise ConnectionFailedError(f"Failed to delete notification: {str(exc)}") from exc
414414

415415
async def reboot_gateway(self) -> None:
416416
"""Reboot the Plugwise Gateway."""
417417
try:
418418
await self._smile_api.reboot_gateway()
419419
except ConnectionFailedError as exc:
420-
raise PlugwiseError(f"Failed to reboot gateway: {str(exc)}") from exc
420+
raise ConnectionFailedError(f"Failed to reboot gateway: {str(exc)}") from exc

0 commit comments

Comments
 (0)