File: device.py

package info (click to toggle)
devolo-plc-api 1.5.1%2Bgit20260208.5d3989e-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 504 kB
  • sloc: python: 1,616; makefile: 6
file content (25 lines) | stat: -rw-r--r-- 732 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
"""Exceptions that can occur when communicating with a devolo device."""


class DeviceNotFound(Exception):
    """The device was not found."""

    def __init__(self, ip: str) -> None:
        """Initialize error."""
        super().__init__(f"The device {ip} did not answer.")


class DeviceUnavailable(Exception):
    """The device is not available, e.g. in standby."""

    def __init__(self) -> None:
        """Initialize error."""
        super().__init__("The device is currently not available. Maybe on standby?")


class DevicePasswordProtected(Exception):
    """The device is password protected."""

    def __init__(self) -> None:
        """Initialize error."""
        super().__init__("The used password is wrong.")