Skip to content

Commit

Permalink
UPD: openrgb-python API methods
Browse files Browse the repository at this point in the history
  • Loading branch information
Spizhen committed May 8, 2021
1 parent 7c8193c commit 5a60ffe
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions custom_components/openrgb/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ def connection_recovered():
def connection_failed():
autolog("<<<")
if hass.data[DOMAIN]["online"]:
hass.data[DOMAIN][ORGB_DATA].comms.stop_connection()
hass.data[DOMAIN][ORGB_DATA].disconnect()
_LOGGER.info(
"Connection lost to OpenRGB SDK Server at %s:%i",
config[CONF_HOST],
Expand Down Expand Up @@ -191,7 +191,7 @@ async def async_poll_devices_update(event_time):
if not hass.data[DOMAIN]["online"]:
# try to reconnect
try:
hass.data[DOMAIN][ORGB_DATA].comms.start_connection()
hass.data[DOMAIN][ORGB_DATA].connect()
hass.data[DOMAIN]["connection_recovered"]()
except OSError:
hass.data[DOMAIN]["connection_failed"]()
Expand Down Expand Up @@ -256,7 +256,7 @@ async def async_unload_entry(hass, entry):
hass.data[DOMAIN][ENTRY_IS_SETUP] = set()
hass.data[DOMAIN][ORGB_TRACKER]()
hass.data[DOMAIN][ORGB_TRACKER] = None
hass.data[DOMAIN][ORGB_DATA].comms.stop_connection()
hass.data[DOMAIN][ORGB_DATA].disconnect()
hass.data[DOMAIN][ORGB_DATA] = None
hass.data[DOMAIN]["unlistener"]()
hass.services.async_remove(DOMAIN, SERVICE_FORCE_UPDATE)
Expand Down

0 comments on commit 5a60ffe

Please sign in to comment.