Skip to content

Commit dc4cc61

Browse files
committed
Minimize startup coms, add logging on usb read errors
1 parent 730f3a8 commit dc4cc61

File tree

2 files changed

+564
-2
lines changed

2 files changed

+564
-2
lines changed

custom_components/wyzesense/binary_sensor.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
55
"""
66

7+
from .wyzesense_custom import *
78
import logging
89
import voluptuous as vol
910
from retry import retry
@@ -44,8 +45,8 @@
4445

4546

4647
def setup_platform(hass, config, add_entites, discovery_info=None):
47-
import wyzesense
4848

49+
_LOGGER.debug("WYZESENSE v0.0.4")
4950
_LOGGER.debug("Attempting to open connection to hub at " + config[CONF_DEVICE])
5051

5152
forced_initial_states = config[CONF_INITIAL_STATE]
@@ -76,7 +77,7 @@ def on_event(ws, event):
7677

7778
@retry(TimeoutError, tries=10, delay=1, logger=_LOGGER)
7879
def beginConn():
79-
return wyzesense.Open(config[CONF_DEVICE], on_event)
80+
return Open(config[CONF_DEVICE], on_event)
8081

8182
ws = beginConn()
8283

0 commit comments

Comments
 (0)