|
1 | | -# Copyright (C) 2011 Sven Petai <[email protected]> |
2 | | -# Use of this source code is governed by the MIT license found in the LICENSE file. |
| 1 | +""" Copyright (C) 2011 Sven Petai <[email protected]>, use of this source code is governed by the MIT license found in the LICENSE file.""" |
3 | 2 |
|
4 | | -### Stick exceptions ### |
5 | 3 |
|
6 | 4 | class PlugwiseException(Exception): |
7 | 5 | """Base error class for this Plugwise library""" |
8 | 6 |
|
9 | | - pass |
| 7 | + |
| 8 | +### Stick exceptions ### |
10 | 9 |
|
11 | 10 |
|
12 | 11 | class PortError(PlugwiseException): |
13 | 12 | """Connection to USBstick failed""" |
14 | 13 |
|
15 | | - pass |
16 | | - |
17 | 14 |
|
18 | 15 | class StickInitError(PlugwiseException): |
19 | 16 | """Initialization of USBstick failed""" |
20 | 17 |
|
21 | | - pass |
22 | | - |
23 | 18 |
|
24 | 19 | class NetworkDown(PlugwiseException): |
25 | 20 | """Zigbee network not online""" |
26 | 21 |
|
27 | | - pass |
28 | | - |
29 | 22 |
|
30 | 23 | class CirclePlusError(PlugwiseException): |
31 | 24 | """Connection to Circle+ node failed""" |
32 | 25 |
|
33 | | - pass |
34 | | - |
35 | 26 |
|
36 | 27 | class ProtocolError(PlugwiseException): |
37 | 28 | """Error while decode received data""" |
38 | 29 |
|
39 | | - pass |
40 | | - |
41 | 30 |
|
42 | 31 | class TimeoutException(PlugwiseException): |
43 | 32 | """Timeout expired while waiting for response from node""" |
44 | 33 |
|
45 | | - pass |
46 | | - |
47 | 34 |
|
48 | 35 | ### Smile exceptions ### |
49 | 36 |
|
50 | 37 |
|
51 | | -class PlugwiseError(Exception): |
52 | | - """Plugwise exceptions class.""" |
53 | | - |
54 | | - pass |
55 | | - |
56 | | - |
57 | | -class ConnectionFailedError(PlugwiseError): |
| 38 | +class ConnectionFailedError(PlugwiseException): |
58 | 39 | """Raised when unable to connect.""" |
59 | 40 |
|
60 | | - pass |
61 | | - |
62 | 41 |
|
63 | | -class InvalidAuthentication(PlugwiseError): |
| 42 | +class InvalidAuthentication(PlugwiseException): |
64 | 43 | """Raised when unable to authenticate.""" |
65 | 44 |
|
66 | | - pass |
67 | | - |
68 | 45 |
|
69 | | -class UnsupportedDeviceError(PlugwiseError): |
| 46 | +class UnsupportedDeviceError(PlugwiseException): |
70 | 47 | """Raised when device is not supported.""" |
71 | 48 |
|
72 | | - pass |
73 | 49 |
|
74 | | - |
75 | | -class DeviceSetupError(PlugwiseError): |
| 50 | +class DeviceSetupError(PlugwiseException): |
76 | 51 | """Raised when device is missing critical setup data.""" |
77 | 52 |
|
78 | | - pass |
79 | | - |
80 | 53 |
|
81 | | -class DeviceTimeoutError(PlugwiseError): |
| 54 | +class DeviceTimeoutError(PlugwiseException): |
82 | 55 | """Raised when device is not supported.""" |
83 | 56 |
|
84 | | - pass |
85 | 57 |
|
86 | | - |
87 | | -class ErrorSendingCommandError(PlugwiseError): |
| 58 | +class ErrorSendingCommandError(PlugwiseException): |
88 | 59 | """Raised when device is not accepting the command.""" |
89 | 60 |
|
90 | | - pass |
91 | | - |
92 | 61 |
|
93 | | -class ResponseError(PlugwiseError): |
| 62 | +class ResponseError(PlugwiseException): |
94 | 63 | """Raised when empty or error in response returned.""" |
95 | 64 |
|
96 | | - pass |
97 | | - |
98 | 65 |
|
99 | | -class InvalidXMLError(PlugwiseError): |
| 66 | +class InvalidXMLError(PlugwiseException): |
100 | 67 | """Raised when response holds incomplete or invalid XML data.""" |
101 | 68 |
|
102 | | - pass |
103 | 69 |
|
104 | | - |
105 | | -class XMLDataMissingError(PlugwiseError): |
| 70 | +class XMLDataMissingError(PlugwiseException): |
106 | 71 | """Raised when xml data is empty.""" |
107 | | - |
108 | | - pass |
0 commit comments