Skip to content

Commit 42b0e7a

Browse files
committed
Fix log leveles
1 parent 5fb9b71 commit 42b0e7a

2 files changed

Lines changed: 9 additions & 5 deletions

File tree

__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
_LOGGER = logging.getLogger(__name__)
2424

2525
UPDATE_TOPIC = f"{DOMAIN}_update"
26-
ERROR_ITERVAL_MAPPING = [10, 60, 300, 600, 3000, 6000]
26+
ERROR_ITERVAL_MAPPING = [0, 10, 60, 300, 600, 3000, 6000]
2727
NOTIFICATION_ID = "ph803w_device_notification"
2828
NOTIFICATION_TITLE = "PH-803W Device status"
2929

lib/discovery.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,20 +37,24 @@ def run(self):
3737
# Receive device reaponse to discovery
3838
data, remote = self._socket.recvfrom(1024)
3939
if data[0] != 0 and data[1] != 0 and data[2] != 0 and data[2] != 3:
40-
_LOGGER.error("Ignore data package because invalid prefix: %s" % data[0:3])
40+
_LOGGER.warning(
41+
"Ignore data package because invalid prefix: %s" % data[0:3]
42+
)
4143
raise DiscoveryError("Ignore data package because invalid prefix")
4244
data_length = data[4]
4345
if len(data) != data_length + 5:
44-
_LOGGER.error(
46+
_LOGGER.warning(
4547
"Ignore data package because invalid length(%s): %s"
4648
% (data_length, data)
4749
)
4850
raise DiscoveryError("Ignore data package because invalid length")
4951
if data[7] == 3:
50-
_LOGGER.error("Unknown response message type")
52+
_LOGGER.warning("Unknown response message type")
5153
raise DiscoveryError("Unknown response message type")
5254
if data[7] != 4:
53-
_LOGGER.error("Ignore data package because invalid message type ${data[7]}")
55+
_LOGGER.warning(
56+
"Ignore data package because invalid message type ${data[7]}"
57+
)
5458
raise DiscoveryError("Ignore data package because invalid message type")
5559

5660
# Parsing result of correct type

0 commit comments

Comments
 (0)