Skip to content

Commit

Permalink
Minimize startup coms, add logging on usb read errors
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinvincent committed Aug 20, 2019
1 parent 730f3a8 commit dc4cc61
Show file tree
Hide file tree
Showing 2 changed files with 564 additions and 2 deletions.
5 changes: 3 additions & 2 deletions custom_components/wyzesense/binary_sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"""

from .wyzesense_custom import *
import logging
import voluptuous as vol
from retry import retry
Expand Down Expand Up @@ -44,8 +45,8 @@


def setup_platform(hass, config, add_entites, discovery_info=None):
import wyzesense

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

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

@retry(TimeoutError, tries=10, delay=1, logger=_LOGGER)
def beginConn():
return wyzesense.Open(config[CONF_DEVICE], on_event)
return Open(config[CONF_DEVICE], on_event)

ws = beginConn()

Expand Down
Loading

0 comments on commit dc4cc61

Please sign in to comment.