|
18 | 18 | PlugwiseData, |
19 | 19 | ThermoLoc, |
20 | 20 | ) |
21 | | -from plugwise.exceptions import ( |
22 | | - InvalidSetupError, |
23 | | - PlugwiseError, |
24 | | - ResponseError, |
25 | | - UnsupportedDeviceError, |
26 | | -) |
| 21 | +from plugwise.exceptions import InvalidSetupError, ResponseError, UnsupportedDeviceError |
27 | 22 | from plugwise.helper import SmileComm |
28 | 23 | from plugwise.legacy.smile import SmileLegacyAPI |
29 | 24 | from plugwise.smile import SmileAPI |
@@ -318,68 +313,41 @@ async def set_schedule_state( |
318 | 313 | name: str | None = None, |
319 | 314 | ) -> None: |
320 | 315 | """Activate/deactivate the Schedule, with the given name, on the relevant Thermostat.""" |
321 | | - try: |
322 | | - await self._smile_api.set_schedule_state(loc_id, new_state, name) |
323 | | - except PlugwiseError as exc: |
324 | | - raise exc |
| 316 | + await self._smile_api.set_schedule_state(loc_id, new_state, name) |
325 | 317 |
|
326 | 318 | async def set_preset(self, loc_id: str, preset: str) -> None: |
327 | 319 | """Set the given Preset on the relevant Thermostat.""" |
328 | | - try: |
329 | | - await self._smile_api.set_preset(loc_id, preset) |
330 | | - except PlugwiseError as exc: |
331 | | - raise exc |
| 320 | + await self._smile_api.set_preset(loc_id, preset) |
332 | 321 |
|
333 | 322 | async def set_temperature(self, loc_id: str, items: dict[str, float]) -> None: |
334 | 323 | """Set the given Temperature on the relevant Thermostat.""" |
335 | | - try: |
336 | | - await self._smile_api.set_temperature(loc_id, items) |
337 | | - except PlugwiseError as exc: |
338 | | - raise exc |
| 324 | + await self._smile_api.set_temperature(loc_id, items) |
339 | 325 |
|
340 | 326 | async def set_number_setpoint(self, key: str, _: str, temperature: float) -> None: |
341 | 327 | """Set the max. Boiler or DHW setpoint on the Central Heating boiler.""" |
342 | | - try: |
343 | | - await self._smile_api.set_number_setpoint(key, temperature) |
344 | | - except PlugwiseError as exc: |
345 | | - raise exc |
| 328 | + await self._smile_api.set_number_setpoint(key, temperature) |
346 | 329 |
|
347 | 330 | async def set_temperature_offset(self, _: str, dev_id: str, offset: float) -> None: |
348 | 331 | """Set the Temperature offset for thermostats that support this feature.""" |
349 | | - try: |
350 | | - await self._smile_api.set_temperature_offset(dev_id, offset) |
351 | | - except PlugwiseError as exc: |
352 | | - raise exc |
| 332 | + await self._smile_api.set_temperature_offset(dev_id, offset) |
353 | 333 |
|
354 | 334 | async def set_switch_state( |
355 | 335 | self, appl_id: str, members: list[str] | None, model: str, state: str |
356 | 336 | ) -> None: |
357 | 337 | """Set the given State of the relevant Switch.""" |
358 | | - try: |
359 | | - await self._smile_api.set_switch_state(appl_id, members, model, state) |
360 | | - except PlugwiseError as exc: |
361 | | - raise exc |
| 338 | + await self._smile_api.set_switch_state(appl_id, members, model, state) |
362 | 339 |
|
363 | 340 | async def set_gateway_mode(self, mode: str) -> None: |
364 | 341 | """Set the gateway mode.""" |
365 | | - try: |
366 | | - await self._smile_api.set_gateway_mode(mode) |
367 | | - except PlugwiseError as exc: |
368 | | - raise exc |
| 342 | + await self._smile_api.set_gateway_mode(mode) |
369 | 343 |
|
370 | 344 | async def set_regulation_mode(self, mode: str) -> None: |
371 | 345 | """Set the heating regulation mode.""" |
372 | | - try: |
373 | | - await self._smile_api.set_regulation_mode(mode) |
374 | | - except PlugwiseError as exc: |
375 | | - raise exc |
| 346 | + await self._smile_api.set_regulation_mode(mode) |
376 | 347 |
|
377 | 348 | async def set_dhw_mode(self, mode: str) -> None: |
378 | 349 | """Set the domestic hot water heating regulation mode.""" |
379 | | - try: |
380 | | - await self._smile_api.set_dhw_mode(mode) |
381 | | - except PlugwiseError as exc: |
382 | | - raise exc |
| 350 | + await self._smile_api.set_dhw_mode(mode) |
383 | 351 |
|
384 | 352 | async def delete_notification(self) -> None: |
385 | 353 | """Delete the active Plugwise Notification.""" |
|
0 commit comments