-
Notifications
You must be signed in to change notification settings - Fork 0
/
exceptions.py
53 lines (40 loc) · 2.07 KB
/
exceptions.py
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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#!/usr/bin/env python3
# vim: set encoding=utf-8 tabstop=4 softtabstop=4 shiftwidth=4 expandtab
#########################################################################
# Copyright 2022- Michael Wenzel [email protected]
#########################################################################
# This file is part of SmartHomeNG.
# https://www.smarthomeNG.de
# https://knx-user-forum.de/forum/supportforen/smarthome-py
#
# Plugin to connect to Foshk / Ecowitt Weather Gateway.
#
# SmartHomeNG is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# SmartHomeNG is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with SmartHomeNG. If not, see <http://www.gnu.org/licenses/>.
#
#########################################################################
# ============================================================================
# Gateway Error classes
# ============================================================================
class InvalidApiResponse(Exception):
"""Exception raised when an API call response is invalid."""
class InvalidChecksum(Exception):
"""Exception raised when an API call response contains an invalid checksum."""
class GatewayIOError(Exception):
"""Exception raised when an input/output error with the Ecowitt Gateway is encountered."""
class UnknownApiCommand(Exception):
"""Exception raised when an unknown API command is used."""
class UnknownHttpCommand(Exception):
"""Exception raised when an unknown HTTP command was selected."""
class GatewayConnectError(Exception):
"""Exception raised when a connection to the gateway could not be established."""